mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(util) rm getDate, getShortDate
This commit is contained in:
parent
6194b1e96d
commit
b8d146c62e
6 changed files with 6 additions and 38 deletions
|
|
@ -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
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = {};
|
||||
|
|
|
|||
29
lib/util.js
29
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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue