[Groonga-commit] groonga/gcs [master] Don't return invalid date

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 16 18:58:55 JST 2012


YUKI Hiroshi	2012-11-16 18:58:55 +0900 (Fri, 16 Nov 2012)

  New Revision: a0fd74c56699f5122c93f487400c53df7482eed5
  https://github.com/groonga/gcs/commit/a0fd74c56699f5122c93f487400c53df7482eed5

  Log:
    Don't return invalid date

  Modified files:
    lib/database/domain.js

  Modified: lib/database/domain.js (+6 -6)
===================================================================
--- lib/database/domain.js    2012-11-16 18:54:58 +0900 (dcff286)
+++ lib/database/domain.js    2012-11-16 18:58:55 +0900 (d39b94e)
@@ -279,9 +279,9 @@ Domain.prototype = {
   },
 
   getOptionCreationDate: function(name) {
-    return this.exists() ?
-      new Date(this.getConfiguration(this.getOptionCreationDateKey(name))) :
-      new Date();
+    var storedDate = this.exists() ?
+          this.getConfiguration(this.getOptionCreationDateKey(name)) : null ;
+    return storedDate ? new Date(storedDate) : new Date();
   },
   setOptionCreationDate: function(name, date) {
     if (this.exists())
@@ -293,9 +293,9 @@ Domain.prototype = {
   },
 
   getOptionUpdateDate: function(name) {
-    return this.exists() ?
-      new Date(this.getConfiguration(this.getOptionUpdateDateKey(name))) :
-      new Date();
+    var storedDate = this.exists() ?
+          this.getConfiguration(this.getOptionUpdateDateKey(name)) : null ;
+    return storedDate ? new Date(storedDate) : new Date();
   },
   setOptionUpdateDate: function(name, date) {
     if (this.exists())
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index