@@ -111,24 +111,21 @@ export function monthsFrom(date, delta) {
111
111
}
112
112
113
113
export function dateStringUTC ( date ) {
114
- let full = String ( date . getUTCDate ( ) ) + ' ' +
115
- shortMonth ( date . getUTCMonth ( ) ) + ' ' +
116
- String ( date . getUTCFullYear ( ) ) + ' at ' ;
117
- let time = {
118
- hours : String ( date . getUTCHours ( ) ) ,
119
- minutes : String ( date . getUTCMinutes ( ) ) ,
120
- seconds : String ( date . getUTCSeconds ( ) )
121
- } ;
122
- for ( let k in time ) {
123
- if ( time [ k ] . length < 2 ) {
124
- time [ k ] = '0' + time [ k ] ;
125
- }
126
- }
127
- full += time . hours + ':' + time . minutes + ':' + time . seconds + ' UTC' ;
128
- return full ;
129
- }
130
-
131
- export function dateStringLocale ( date ) {
114
+ // let full = String(date.getUTCDate()) + ' ' +
115
+ // shortMonth(date.getUTCMonth()) + ' ' +
116
+ // String(date.getUTCFullYear()) + ' at ';
117
+ // let time = {
118
+ // hours: String(date.getUTCHours()),
119
+ // minutes: String(date.getUTCMinutes()),
120
+ // seconds: String(date.getUTCSeconds())
121
+ // };
122
+ // for (let k in time) {
123
+ // if (time[k].length < 2) {
124
+ // time[k] = '0' + time[k];
125
+ // }
126
+ // }
127
+ // full += time.hours + ':' + time.minutes + ':' + time.seconds + ' UTC';
128
+ // return full;
132
129
let month = date . getMonth ( ) + 1
133
130
let date2 = date . getDate ( )
134
131
if ( month < 10 ) {
@@ -137,9 +134,6 @@ export function dateStringLocale(date) {
137
134
if ( date2 < 10 ) {
138
135
date2 = "0" + date2 ;
139
136
}
140
- // let full = String(date.getDate()) + ' ' +
141
- // shortMonth(date.getMonth()) + ' ' +
142
- // String(date.getFullYear()) + ' at ';
143
137
let full = String ( String ( date . getFullYear ( ) + '-' + month + '-' + date2 + ' ' ) )
144
138
let time = {
145
139
hours : String ( date . getHours ( ) ) ,
@@ -155,6 +149,33 @@ export function dateStringLocale(date) {
155
149
return full ;
156
150
}
157
151
152
+ // export function dateStringLocale(date) {
153
+ // let month=date.getMonth()+1
154
+ // let date2=date.getDate()
155
+ // if(month<10){
156
+ // month = "0" + month;
157
+ // }
158
+ // if(date2<10){
159
+ // date2 = "0" + date2;
160
+ // }
161
+ // // let full = String(date.getDate()) + ' ' +
162
+ // // shortMonth(date.getMonth()) + ' ' +
163
+ // // String(date.getFullYear()) + ' at ';
164
+ // let full=String(String(date.getFullYear()+'-'+month+'-'+date2 +' '))
165
+ // let time = {
166
+ // hours: String(date.getHours()),
167
+ // minutes: String(date.getMinutes()),
168
+ // seconds: String(date.getSeconds())
169
+ // };
170
+ // for (let k in time) {
171
+ // if (time[k].length < 2) {
172
+ // time[k] = '0' + time[k];
173
+ // }
174
+ // }
175
+ // full += time.hours + ':' + time.minutes + ':' + time.seconds;
176
+ // return full;
177
+ // }
178
+
158
179
export function monthDayStringUTC ( date ) {
159
180
return `${ shortMonth ( date . getUTCMonth ( ) ) } ${ date . getUTCDate ( ) } ` ;
160
181
}
0 commit comments