forked from MapComplete/MapComplete
Refactoring: improve special components
This commit is contained in:
parent
fcc49766d4
commit
94635337e6
4 changed files with 16 additions and 23 deletions
|
@ -10,6 +10,11 @@ export default class DateValidator extends Validator {
|
|||
}
|
||||
|
||||
reformat(str: string) {
|
||||
console.log("Reformatting", str)
|
||||
if (!this.isValid(str)) {
|
||||
// The date is invalid - we return the string as is
|
||||
return str
|
||||
}
|
||||
const d = new Date(str)
|
||||
let month = "" + (d.getMonth() + 1)
|
||||
let day = "" + d.getDate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue