mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
'Y-m-d\\TH:i:s' as 'ISO8601'
This commit is contained in:
parent
a451600d8b
commit
a9b336d90f
2 changed files with 2 additions and 2 deletions
|
|
@ -134,7 +134,7 @@ export const
|
||||||
timeToNode = (element, time) => {
|
timeToNode = (element, time) => {
|
||||||
try {
|
try {
|
||||||
if (time) {
|
if (time) {
|
||||||
element.dateTime = (new Date(time * 1000)).format('Y-m-d\\TH:i:s');
|
element.dateTime = (new Date(time * 1000)).format('ISO8601');
|
||||||
} else {
|
} else {
|
||||||
time = Date.parse(element.dateTime) / 1000;
|
time = Date.parse(element.dateTime) / 1000;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
dev/prototype.js
vendored
2
dev/prototype.js
vendored
|
|
@ -46,7 +46,7 @@
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
|
||||||
Date.prototype.format = function (options, UTC, hourCycle) {
|
Date.prototype.format = function (options, UTC, hourCycle) {
|
||||||
if (typeof options == 'string') {
|
if (typeof options == 'string') {
|
||||||
if ('Y-m-d\\TH:i:s' == options) {
|
if ('ISO8601' == options) {
|
||||||
return this.getFullYear() + '-' + pad2(1 + this.getMonth()) + '-' + pad2(this.getDate())
|
return this.getFullYear() + '-' + pad2(1 + this.getMonth()) + '-' + pad2(this.getDate())
|
||||||
+ 'T' + pad2(this.getHours()) + ':' + pad2(this.getMinutes()) + ':' + pad2(this.getSeconds());
|
+ 'T' + pad2(this.getHours()) + ':' + pad2(this.getMinutes()) + ':' + pad2(this.getSeconds());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue