mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
ee39df37be
b96996dc12c52fdefb6da21a52aa9ad23b81066a
165 lines
4.8 KiB
JSON
165 lines
4.8 KiB
JSON
{
|
|
"cases": [
|
|
{
|
|
"name": "formatDateAsUTC(setDay(parseUnixTime(0), 13)) => 01/01/1970 00:00:000",
|
|
"expression": "@{formatDateAsUTC(setDay(parseUnixTime(0), 13), 'dd/MM/yyyy HH:mm:SSS')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "13/01/1970 00:00:000"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0)) => Thu, Jan 1, 70",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(0), 'EEE, MMM d, yy', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "Thu, Jan 1, 70"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0), en-US) => 12 o'clock AM",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(0), 'hh \\'o\\'\\'clock\\' a', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "12 o'clock AM"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0), en-US) => 01970 January 01 AD 12:00 AM",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(0), 'yyyyy MMMM dd GGG hh:mm aaa', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "01970 January 01 AD 12:00 AM"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0), en-US) => 0:00 AM",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(0), 'K:mm a', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "0:00 AM"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(setDay(parseUnixTime(0), 13), en-US) => 1970-01-01T00:00:00.000",
|
|
"expression": "@{formatDateAsUTCWithLocale(setDay(parseUnixTime(0), 13), 'yyyy-MM-dd\\'T\\'HH:mm:ss.SSS', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "1970-01-13T00:00:00.000"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(3927600), 'en-US') => 1970-02-03, week of year 8",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(3927600), 'yyyy-MM-dd\\', week of year \\'w', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "1970-02-15, week of year 8"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(3927600), 'ru-RU') => 1970-02-03, week of year 7",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(3927600), 'yyyy-MM-dd\\', week of year \\'w', 'ru-RU')}",
|
|
"platform_specific": {
|
|
"web": {
|
|
"weekStartDay": 1
|
|
}
|
|
},
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "1970-02-15, week of year 7"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(3927600), 'en-US') => 1970-02-03, week of month 3",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(3927600), 'yyyy-MM-dd\\', week of month \\'W', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "1970-02-15, week of month 3"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0), 'en-US') => Year 1970, extended year 1970",
|
|
"expression": "@{formatDateAsUTCWithLocale(parseUnixTime(0), '\\'Year \\'yyyy\\', extended year \\'u', 'en-US')}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "Year 1970, extended year 1970"
|
|
},
|
|
"platforms": [
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTCWithLocale(parseUnixTime(0), 'ru-RU') => 1970 января 01 н. э. чт",
|
|
"expression": "@{toLowerCase(formatDateAsUTCWithLocale(parseUnixTime(0), 'yyyy MMMM dd GGG EEE', 'ru-RU'))}",
|
|
"expected": {
|
|
"type": "string",
|
|
"value": "1970 января 01 н. э. чт"
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
},
|
|
{
|
|
"name": "formatDateAsUTC(parseUnixTime(0), 'dd/MM/yyyy HH:mm Z') => error",
|
|
"expression": "@{formatDateAsUTC(parseUnixTime(0), 'dd/MM/yyyy HH:mm Z')}",
|
|
"expected": {
|
|
"type": "error",
|
|
"value": "Failed to evaluate [formatDateAsUTC(1970-01-01 00:00:00, 'dd/MM/yyyy HH:mm Z')]. z/Z not supported in [dd/MM/yyyy HH:mm Z]."
|
|
},
|
|
"platforms": [
|
|
"android",
|
|
"ios",
|
|
"web"
|
|
]
|
|
}
|
|
]
|
|
}
|