35 lines
No EOL
697 B
JavaScript
35 lines
No EOL
697 B
JavaScript
const DBParser = require(`./parser.JS`);
|
|
|
|
class Activity extends DBParser {
|
|
/*
|
|
Modify user information.
|
|
|
|
@param {Object} ENTRY the selected entry, or the entries
|
|
*/
|
|
constructor(ENTRY) {
|
|
super(ENTRY, {
|
|
"username": "username",
|
|
"description": "description",
|
|
"duration": "duration",
|
|
"date": "date",
|
|
"_id": "ID"
|
|
});
|
|
|
|
this.convert_date();
|
|
};
|
|
|
|
/*
|
|
Convert the date to the needed format.
|
|
|
|
@param {Date} DATE the target date
|
|
@return {String} the date
|
|
*/
|
|
convert_date(DATE) {
|
|
if (DATE || this.data.date) {
|
|
this.date = (new Date(DATE || this.data.date)).toDateString();
|
|
return (this.date);
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = Activity; |