OSDN Git Service

article-editor: set new story's create time to 30 minutes after
[newslash/newslash.git] / src / newslash_web / public / js / article-editor.js
index 00fa150..7cab43e 100644 (file)
@@ -411,7 +411,8 @@ articleEditor.init = function init () {
 
   function _createNewStory() {
     // set createtime
-    this.editor.createtime = newslash.util.formatToLocalISOString(new Date());
+    var dt = new Date((new Date()).getTime() + (30 * 60 * 1000));
+    this.editor.createtime = newslash.util.formatToLocalISOString(dt);
     this.editor.author = user.nickname;
 
     // start editing
@@ -444,7 +445,8 @@ articleEditor.init = function init () {
     if (item.create_time) {
       this.editor.createtime = newslash.util.formatToLocalISOString(newslash.util.decodeMySQLDateTime(item.create_time));
     } else {
-      this.editor.createtime = newslash.util.formatToLocalISOString(new Date());
+      var dt = new Date((new Date()).getTime() + (30 * 60 * 1000));
+      this.editor.createtime = newslash.util.formatToLocalISOString(dt);
     }
     this.editor.id = item.stoid;
     this.editor.author = user.nickname;