diff --git a/gulp/tasks/docs.js b/gulp/tasks/docs.js index 790f6cb5..58df3c7e 100644 --- a/gulp/tasks/docs.js +++ b/gulp/tasks/docs.js @@ -6,7 +6,7 @@ cl = require('../cl'), place = require('place'), rendy = require('rendy'), - Util = require(DIR + 'lib/util'), + shortdate = require('shortdate'), Info = require(DIR + 'package'); module.exports = function(callback) { @@ -24,7 +24,7 @@ replaceVersion('README.md', version, versionNew, callback); replaceVersion('HELP.md', version, versionNew, function() { var historyNew = history + rendy(template, { - date : Util.getShortDate, + date : shortdate(), version : versionNew }); diff --git a/lib/client.js b/lib/client.js index d854bb46..5be453b1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -9,12 +9,8 @@ var Util, DOM, CloudFunc, join; var Key, Debug, log = function(str) { - var date = Util.getShortDate(), - time = Util.getTime(), - prefix = date + ' ' + time; - if (Debug) - console.log('[' + prefix + '] ' + str); + console.log(str); }, Listeners, diff --git a/lib/client/storage/_dropbox.js b/lib/client/storage/_dropbox.js index 83def8c6..3cc15e4f 100644 --- a/lib/client/storage/_dropbox.js +++ b/lib/client/storage/_dropbox.js @@ -130,7 +130,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dropbox, cb, Client; if (data) { if (!name) - name = Util.getDate(); + name = new Date(); DOM.Images.show.load(); diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index efdb3d50..49176025 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -116,7 +116,7 @@ var CloudCmd, Util, join, DOM, CloudFunc, Github, cb; DOM.Images.show.load(); if (!name) - name = Util.getDate(); + name = new Date(); gist = GH.getGist(); files = {}; diff --git a/lib/util.js b/lib/util.js index deac5c74..bd025ac4 100644 --- a/lib/util.js +++ b/lib/util.js @@ -669,35 +669,6 @@ return this; }; - - /** - * Gets current date in format yy.mm.dd hh:mm:ss - */ - this.getDate = function() { - var date = Util.getShortDate(), - time = Util.getTime(), - ret = date + ' ' + time; - - return ret; - }; - - this.getShortDate = function() { - var ret, - date = new Date(), - day = date.getDate(), - month = date.getMonth() + 1, - year = date.getFullYear(); - - if (month <= 9) - month = '0' + month; - - if (day <= 9) - day = '0' + day; - - ret = year + '.' + month + '.' + day; - - return ret; - }; } })(this); diff --git a/package.json b/package.json index 5ec696d9..25a4242c 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "morgan": "~1.5.0", "place": "~1.0.0", "prepend": "~1.0.2", + "shortdate": "~1.0.1", "should": "~4.4.1", "version-io": "~1.0.3" },