Browse Source

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

master
frtk 5 years ago
parent
commit
ba13bb6a32
2 changed files with 0 additions and 83 deletions
  1. +0
    -25
      server/server_params.js
  2. +0
    -58
      server/server_utils.js

+ 0
- 25
server/server_params.js 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;
}

+ 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