1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 17:59:25 +00:00

Added TestDate class to help format dates correctly

This commit is contained in:
2022-02-25 13:15:36 +00:00
parent 747d7f8e77
commit 48176a28fe

View File

@@ -1,5 +1,20 @@
'use strict';
/**
* A class that represents the date of a test
*/
class TestDate extends Date {
/**
* Overwrite the default string casting implementation to format
* all dates in the British format
*
* @returns {string} The formatted date
*/
toString() {
return this.toLocaleDateString('en-GB');
}
}
class Test {
testId;
testTemplateId;