Browse Source

delete

tmp/e2eb0b63836ba6a298bbf6315c8bce5c/head
frtk 5 years ago
parent
commit
4c20da7d65
1 changed files with 0 additions and 58 deletions
  1. +0
    -58
      server/server_utils.js

+ 0
- 58
server/server_utils.js View File

@ -1,58 +0,0 @@
/**
* @file server_utils.js
* @author frtk
*/
/**
* lib : DateLib
* purpose : date utils
*/
var datelib = {
//--- dateToString
dateToString: function(date) {
var self = this;
return '[' + self.addZero(date.getHours(), 'h') + ':'
+ self.addZero(date.getMinutes(), 'm') + ':'
+ self.addZero(date.getSeconds(), 's') + ':'
+ self.addZero(date.getMilliseconds(), 'ms') + ']';
},
//--- addZero
addZero: function(value, type) {
switch(type) {
case 'h':
case 'm':
case 's':
if (value < 10) value = '0' + value;
break;
case 'ms':
if (value < 10) value = '00' + value;
else if (value >= 10 && value < 100) value = '0' + value;
break;
default:
break;
};
return value;
},
//--- return new date string
newDateToString: function() {
var self = this;
return self.dateToString(new Date());
}
};
/**
*
* EXPORTS
*
*/
if (typeof exports !== "undefined") {
//--- Objects
exports.datelib = datelib;
}

Loading…
Cancel
Save