1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

feat: ampm modifier for dates

This commit is contained in:
diced 2024-02-01 16:24:24 -08:00
parent 1a837c02d2
commit 1816e13879
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -128,6 +128,10 @@ function modifier(mod: string, value: unknown, tzlocale?: string): string {
return value.getMinutes().toString();
case 'second':
return value.getSeconds().toString();
case 'ampm':
return value.getHours() < 12 ? 'am' : 'pm';
case 'AMPM':
return value.getHours() < 12 ? 'AM' : 'PM';
default:
return '{unknown_date_modifier}';
}