You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `YMDET` | “Fri, 5/17/24, 3:47:50 PM” ⇒ year, month, day, and weekday with time |
403
+
| `YMDT` | “5/17/24, 3:47:50 PM” ⇒ year, month, and day with time |
404
+
356
405
357
406
#### DateTime fields
407
+
Use the function `:datetime` and use an _option_ to indicate the fieldset.
358
408
359
-
Options:
409
+
The _option_ might have a generic name, such as `fields`,
410
+
or it might have sematic names such as `date`/`dateFields`/`time`/`timeFields`.
411
+
Option values would be as shown in the table above.
360
412
361
413
```
362
414
{$date :datetime dateFields=YMD}
363
415
{$date :datetime date=YMD}
364
416
{$date :datetime fields=YMD}
365
417
```
366
418
367
-
The names `dateFields`, `date`, and `fields` are candidate names for the option that specifies the semantic skeleton string to be used for formatting the date/time value.
368
419
#### TimePrecision
420
+
Note that in the table above, there is only one fieldset of "time" values.
421
+
Use a `timePrecision` option to indicate which subfields of a time are desired.
422
+
Time formats within a locale don't generally have field lengths
423
+
(although zero- versus non-zero filled hours is a variation)
424
+
and thus it is sufficient to say what the "last field to show" would be.
369
425
370
-
Options:
426
+
The name `timePrecision` is a placeholder.
427
+
This option might be shortened to just `time`.
428
+
429
+
For example:
371
430
```
372
-
{$date :datetime timePrecision=minute}
373
-
{$date :datetime time=minute}
431
+
{$date :datetime timePrecision=minute} ⇒ 11:39 AM
432
+
{$date :datetime time=second} ⇒ 11:39:00 AM
374
433
```
375
-
(TODO: Add others)
376
434
377
435
### Design: Use Separate Functions
378
436
@@ -395,6 +453,7 @@ _Pros_
395
453
396
454
_Cons_
397
455
- Not fully type-safe.
456
+
- The `:datetime` function might duplicate functionality
0 commit comments