Merge branch 'master' of git.tetalab.org:frtk/nodePong

This commit is contained in:
frtk 2016-02-13 00:43:07 +01:00
commit ba13bb6a32
2 changed files with 0 additions and 83 deletions

View File

@ -1,25 +0,0 @@
/**
* @file server_params.js
* @author frtk
*/
/**
*
* server parameters
*
*/
var params = {
port: 8042,
}
/**
*
* EXPORT
*
*/
if (typeof exports !== "undefined") {
exports.params = params;
}

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