W3C home > Mailing lists > Public > public-dap-commits@w3.org > June 2010

2009/dap/ReSpec.js/js respec.js,1.118,1.119

From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 23 Jun 2010 13:24:37 +0000
To: public-dap-commits@w3.org
Message-Id: <E1ORPwT-00036f-9u@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv11922/ReSpec.js/js

Modified Files:
	respec.js 
Log Message:
default to last modification instead of today

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- respec.js	23 Jun 2010 09:37:28 -0000	1.118
+++ respec.js	23 Jun 2010 13:24:35 -0000	1.119
@@ -322,7 +322,9 @@
         else              cfg = {};
         // defaulting
         if (!cfg.specStatus) cfg.specStatus = "ED";
-        if (!cfg.publishDate) cfg.publishDate = new Date();
+        // the below is experimental, use this if it fails:
+        // cfg.publishDate = new Date();
+        if (!cfg.publishDate) cfg.publishDate = this._parseLastModified(document.lastModified);
         else cfg.publishDate = this._parseDate(cfg.publishDate);
         if (cfg.previousPublishDate) cfg.previousPublishDate = this._parseDate(cfg.previousPublishDate);
         if (cfg.previousPublishDate && ! cfg.previousMaturity) error("Previous date is set, but not previousMaturity");
@@ -1116,6 +1118,11 @@
     _parseDate:    function (str) {
         return new Date(str.substr(0, 4), (str.substr(5, 2) - 1), str.substr(8, 2));
     },
+
+    _parseLastModified:    function (str) {
+        return new Date(str.substr(6, 4), (str.substr(0, 2) - 1), str.substr(3, 2));
+    },
+    
     
     _lead0:    function (str) {
         str = "" + str;
Received on Wednesday, 23 June 2010 13:24:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 June 2010 13:24:39 GMT