* Some code cleanup
This commit is contained in:
parent
4505ad17e2
commit
7f4c97329d
|
@ -130,14 +130,14 @@ function connectEntry(client) {
|
|||
//
|
||||
displayBanner(term);
|
||||
|
||||
/* var art1 = require('fs').readFileSync('/home/nuskooler/dev/enigma-bbs/mods/themes/NU-MAYA/APPLY1.ANS');
|
||||
/*
|
||||
var art1 = require('fs').readFileSync('/home/nuskooler/dev/enigma-bbs/mods/themes/NU-MAYA/APPLY1.ANS');
|
||||
term.rawWrite(art1);
|
||||
|
||||
term.write(ansi.resetScreen());
|
||||
theme.displayThemeArt({client : client, name : 'APPLY1.ANS'}, function onArt() {
|
||||
|
||||
});
|
||||
*/
|
||||
*/
|
||||
|
||||
setTimeout(function onTimeout() {
|
||||
client.gotoMenuModule( { name : Config.firstMenu });
|
||||
}, 500);
|
||||
|
|
25
core/user.js
25
core/user.js
|
@ -320,35 +320,10 @@ User.prototype.persistProperties = function(cb) {
|
|||
});
|
||||
};
|
||||
|
||||
// :TODO: A general purpose date/time formatting class or lib would be better here....
|
||||
User.prototype.getFormattedBirthDate = function(style) {
|
||||
style = style || 'medium';
|
||||
|
||||
switch(style) {
|
||||
|
||||
case 'medium' :
|
||||
return _.has(this.properties, 'birthdate') ?
|
||||
new Date(Date.parse(this.properties.birthdate)).toJSON().slice(0, 10) :
|
||||
null;
|
||||
}
|
||||
};
|
||||
|
||||
User.prototype.getAge = function() {
|
||||
if(_.has(this.properties, 'birthdate')) {
|
||||
return moment().diff(this.properties.birthdate, 'years');
|
||||
}
|
||||
/*
|
||||
if(!isNaN(birthDate)) {
|
||||
var today = new Date();
|
||||
var age = today.getFullYear() - birthDate.getFullYear();
|
||||
var m = today.getMonth() - birthDate.getMonth();
|
||||
if(m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age;
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue