File tree 2 files changed +46
-0
lines changed
datetime-button/test/basic 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -215,8 +215,41 @@ <h2>preferWheel / date-time</h2>
215
215
> </ ion-datetime >
216
216
</ ion-popover >
217
217
</ div >
218
+
219
+ < div class ="grid-item ">
220
+ < h2 > formatOptions</ h2 >
221
+
222
+ < ion-item >
223
+ < ion-label > Start Date</ ion-label >
224
+ < ion-datetime-button datetime ="format-options " slot ="end "> </ ion-datetime-button >
225
+ </ ion-item >
226
+
227
+ < ion-popover arrow ="false ">
228
+ < ion-datetime
229
+ id ="format-options "
230
+ presentation ="date-time "
231
+ value ="2023-11-02T01:22:00 "
232
+ locale ="en-US "
233
+ > </ ion-datetime >
234
+ </ ion-popover >
235
+ </ div >
218
236
</ div >
219
237
</ ion-content >
220
238
</ ion-app >
221
239
</ body >
240
+
241
+ < script >
242
+ const formatOptionsDatetime = document . querySelector ( '#format-options' ) ;
243
+ formatOptionsDatetime . formatOptions = {
244
+ date : {
245
+ weekday : 'short' ,
246
+ month : 'long' ,
247
+ day : '2-digit' ,
248
+ } ,
249
+ time : {
250
+ hour : '2-digit' ,
251
+ minute : '2-digit' ,
252
+ } ,
253
+ } ;
254
+ </ script >
222
255
</ html >
Original file line number Diff line number Diff line change @@ -308,6 +308,13 @@ <h2>Modal - Custom</h2>
308
308
</ ion-datetime >
309
309
</ ion-modal >
310
310
</ div >
311
+
312
+ < div class ="grid-item ">
313
+ < h2 > formatOptions</ h2 >
314
+ < ion-datetime value ="2020-03-14T14:23:00.000Z " id ="format-options-datetime ">
315
+ < span slot ="title "> Select Date</ span >
316
+ </ ion-datetime >
317
+ </ div >
311
318
</ div >
312
319
</ ion-content >
313
320
< script >
@@ -403,6 +410,12 @@ <h2>Modal - Custom</h2>
403
410
app . appendChild ( modalElement ) ;
404
411
return modalElement ;
405
412
} ;
413
+
414
+ const formatOptions = document . querySelector ( '#format-options-datetime' ) ;
415
+ formatOptions . formatOptions = {
416
+ time : { hour : '2-digit' , minute : '2-digit' } ,
417
+ date : { day : '2-digit' , month : 'long' , era : 'short' } ,
418
+ } ;
406
419
</ script >
407
420
</ ion-app >
408
421
</ body >
You can’t perform that action at this time.
0 commit comments