1
0
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:
2022-04-18 19:12:08 +00:00
parent 6b409bca41
commit 0b4be056c6
2 changed files with 1 additions and 1 deletions

15
lib/MySQLDate.js Normal file
View 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;