feature(util) rm getDate, getShortDate

This commit is contained in:
coderaiser 2015-01-12 10:17:46 -05:00
parent 6194b1e96d
commit b8d146c62e
6 changed files with 6 additions and 38 deletions

View file

@ -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
});

View file

@ -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,

View file

@ -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();

View file

@ -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 = {};

View file

@ -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);

View file

@ -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"
},