Example
<cr-component id="component" name="input-date-range" loading></cr-component>
<script>
const component = document.querySelector("#component");
component.init({
minDate: 1458604800000,
maxDate: 1674172800000,
defaultPeriod: "SI",
});
</script>
Schema
{
"type": "object",
"required": [
"minDate"
],
"properties": {
"periods": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"default": "SI",
"description": "A period must be one of 1W,2W,1M,3M,6M,YTD,1Y,3Y,5Y,10Y,SI or a string containig two valid dates like 20211012-20220812",
"enum": [
"1W",
"2W",
"1M",
"3M",
"6M",
"YTD",
"1Y",
"3Y",
"5Y",
"10Y",
"SI"
]
},
{
"type": "string",
"default": "SI",
"description": "A period must be one of 1W,2W,1M,3M,6M,YTD,1Y,3Y,5Y,10Y,SI or a string containig two valid dates like 20211012-20220812",
"minLength": 4,
"maxLength": 4
}
]
},
"default": [
"1W",
"2W",
"1M",
"3M",
"6M",
"YTD",
"1Y",
"3Y",
"5Y",
"10Y",
"SI"
]
},
"defaultPeriod": {
"type": "string",
"default": "SI",
"description": "A period must be one of 1W,2W,1M,3M,6M,YTD,1Y,3Y,5Y,10Y,SI or a string containig two valid dates like 20211012-20220812",
"enum": [
"1W",
"2W",
"1M",
"3M",
"6M",
"YTD",
"1Y",
"3Y",
"5Y",
"10Y",
"SI"
]
},
"minDate": {
"type": [
"string",
"number"
]
},
"maxDate": {
"type": [
"string",
"number"
]
}
},
"additionalProperties": true
}
Complete Schema
{}
Locales
{}