input datetime-local needs day to also be two digits
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
29c41865d0
commit
4ea6466f1e
|
@ -4,6 +4,14 @@
|
|||
* @returns {string}
|
||||
*/
|
||||
export function toISOUTCString(date) {
|
||||
let month = (date.getMonth() + 1).toString().padStart(2, 0);
|
||||
return `${date.getFullYear()}-${month}-${date.getDate()}T${date.getHours()}:${date.getMinutes()}`;
|
||||
function stringAndPad(number) {
|
||||
return number.toString().padStart(2, 0);
|
||||
}
|
||||
return `${
|
||||
date.getFullYear()}-
|
||||
${stringAndPad(date.getMonth() + 1)}-
|
||||
${stringAndPad(date.getDate())}T
|
||||
${stringAndPad(date.getHours())}:
|
||||
${stringAndPad(date.getMinutes())
|
||||
}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue