File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
3
+ */
4
+ if ( ! Date . prototype . toISOString ) {
5
+ ( function ( ) {
6
+
7
+ function pad ( number ) {
8
+ if ( number < 10 ) {
9
+ return '0' + number ;
10
+ }
11
+ return number ;
12
+ }
13
+
14
+ Date . prototype . toISOString = function ( ) {
15
+ return this . getUTCFullYear ( ) +
16
+ '-' + pad ( this . getUTCMonth ( ) + 1 ) +
17
+ '-' + pad ( this . getUTCDate ( ) ) +
18
+ 'T' + pad ( this . getUTCHours ( ) ) +
19
+ ':' + pad ( this . getUTCMinutes ( ) ) +
20
+ ':' + pad ( this . getUTCSeconds ( ) ) +
21
+ '.' + ( this . getUTCMilliseconds ( ) / 1000 ) . toFixed ( 3 ) . slice ( 2 , 5 ) +
22
+ 'Z' ;
23
+ } ;
24
+
25
+ } ( ) ) ;
26
+ }
Original file line number Diff line number Diff line change @@ -845,3 +845,30 @@ if (!String.prototype.trim) {
845
845
return this . replace ( / ^ [ \s \uFEFF \xA0 ] + | [ \s \uFEFF \xA0 ] + $ / g, '' ) ;
846
846
} ;
847
847
}
848
+ //toISOString.js
849
+ /*
850
+ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
851
+ */
852
+ if ( ! Date . prototype . toISOString ) {
853
+ ( function ( ) {
854
+
855
+ function pad ( number ) {
856
+ if ( number < 10 ) {
857
+ return '0' + number ;
858
+ }
859
+ return number ;
860
+ }
861
+
862
+ Date . prototype . toISOString = function ( ) {
863
+ return this . getUTCFullYear ( ) +
864
+ '-' + pad ( this . getUTCMonth ( ) + 1 ) +
865
+ '-' + pad ( this . getUTCDate ( ) ) +
866
+ 'T' + pad ( this . getUTCHours ( ) ) +
867
+ ':' + pad ( this . getUTCMinutes ( ) ) +
868
+ ':' + pad ( this . getUTCSeconds ( ) ) +
869
+ '.' + ( this . getUTCMilliseconds ( ) / 1000 ) . toFixed ( 3 ) . slice ( 2 , 5 ) +
870
+ 'Z' ;
871
+ } ;
872
+
873
+ } ( ) ) ;
874
+ }
You can’t perform that action at this time.
0 commit comments