You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/04 07:23:41 UTC

[09/11] incubator-ponymail git commit: use YYY-MM-DD HH:mm format

use YYY-MM-DD HH:mm format


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/9d75f3c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/9d75f3c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/9d75f3c4

Branch: refs/heads/coffee-and-cake
Commit: 9d75f3c432c3454c4129f9cbcee1f29407cbbbb6
Parents: 61b84df
Author: Daniel Gruno <hu...@apache.org>
Authored: Sun Sep 4 09:22:36 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sun Sep 4 09:22:36 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/misc.coffee | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9d75f3c4/site/js/coffee/misc.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/misc.coffee b/site/js/coffee/misc.coffee
index e298666..4fb4044 100644
--- a/site/js/coffee/misc.coffee
+++ b/site/js/coffee/misc.coffee
@@ -40,12 +40,14 @@ Number.prototype.pad = (n) ->
         str = "0".repeat(n-str.length) + str
     return str
 
-### Func for converting a date to YYYY-MM-DD ###
+### Func for converting a date to YYYY-MM-DD HH:MM ###
 Date.prototype.ISOBare = () ->
     y = this.getFullYear()
-    m = this.getMonth() + 1
-    d = this.getDate()
-    return y + "-" + m.pad(2) + "-" + d.pad(2)
+    m = (this.getMonth() + 1).pad(2)
+    d = this.getDate().pad(2)
+    h = this.getHours().pad(2)
+    M = this.getMinutes().pad(2)
+    return "#{y}-#{m}-#{d} #{h}:#{M}"
 
 ### isArray: function to detect if an object is an array ###
 isArray = (value) ->