mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 19:59:27 +00:00
Generalise MySQLDate to lib
This commit is contained in:
15
lib/MySQLDate.js
Normal file
15
lib/MySQLDate.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
// Class for easy insertion of test dates into the database
|
||||
class MySQLDate extends Date {
|
||||
toString() {
|
||||
return this.toISOString().slice(0, 19).replace('T', ' ');
|
||||
}
|
||||
|
||||
alterDays(amount) {
|
||||
this.setDate(this.getDate() + amount);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MySQLDate;
|
||||
Reference in New Issue
Block a user