cldr
Version:
Library for extracting data from CLDR (the Unicode Common Locale Data Repository)
68 lines (67 loc) • 1.38 kB
JSON
{
"$schema": "https://raw.githubusercontent.com/unicode-org/message-format-wg/main/test/schemas/v0/tests.schema.json",
"scenario": "Datetime function",
"description": "The built-in formatter for datetimes.",
"defaultTestProperties": {
"bidiIsolation": "none",
"locale": "en-US",
"expErrors": false
},
"tests": [
{
"src": "{:datetime}",
"exp": "{:datetime}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "{$x :datetime}",
"exp": "{$x}",
"params": [
{
"name": "x",
"value": true
}
],
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "{horse :datetime}",
"exp": "{|horse|}",
"expErrors": [
{
"type": "bad-operand"
}
]
},
{
"src": "{|2006-01-02T15:04:06| :datetime}"
},
{
"src": "{|2006-01-02T15:04:06| :datetime year=numeric month=|2-digit|}"
},
{
"src": "{|2006-01-02T15:04:06| :datetime dateStyle=long}"
},
{
"src": "{|2006-01-02T15:04:06| :datetime timeStyle=medium}"
},
{
"src": "{$dt :datetime}",
"params": [
{
"type": "datetime",
"name": "dt",
"value": "2006-01-02T15:04:06"
}
]
}
]
}