mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 22:19:26 +00:00
Added TestDate class to help format dates correctly
This commit is contained in:
15
lib/Test.js
15
lib/Test.js
@@ -1,5 +1,20 @@
|
|||||||
'use strict';
|
'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 {
|
class Test {
|
||||||
testId;
|
testId;
|
||||||
testTemplateId;
|
testTemplateId;
|
||||||
|
|||||||
Reference in New Issue
Block a user