Timezone
Convert and display data from UTC format to your own time zone
info
startDate and endDate should not be in UTC format
info
Timezone support converts the 'since' and 'till' values of each element from UTC to the specified timezone. Please note that these values must always be provided in UTC (universal time).
When the timezone is enabled, all elements' data — including the 'since' and 'till' values — will be converted from UTC to the specified timezone. This is useful when you have EPG data in UTC format and want to display it in a different timezone.
Timezone schema
| Property | Type | Status | Values |
|---|---|---|---|
enabled | boolean | required | |
mode | string | required | utc |
zone | string | required | Specify your timezone eg. Europe/Paris, America/New_York. Please make user your timezone value is correct |
{
"enabled": true,
"mode": "utc",
"zone": "Europe/Paris"
}
Timezone example
const { getEpgProps, getLayoutProps } = useEpg({
channels,
epg,
startDate, // startDate should not be in UTC format
endDate, // endDate should not be in UTC format
timezone: {
enabled: true,
mode: "utc",
zone: "Europe/Paris",
},
...
});
`;