A custom timezone toolkit on narando architecture.
npm install @narando/timezonesA custom timezone toolkit on narando architecture.
You need to have nodejs and npm installed.
``bash`
$ npm install @narando/timezones
Get a list of all timezones to fill a
To create an instance of the timezones module you have to import timezones
`javascript
import buildTimezoneList from "@narando/buildTimezoneList";
function handleRequest(req, res) {
// You can use the function to get a grouped list of all timezones.
// With the parameter set is the given timezone preselected.
// This list can be used to generate an
res.render(page/article, res.locals);`
}
The timezones will be displayed by the following mustache logic.
In this case it will display all timezones with the user timezone selected.
``
To format a UTC in a given timezone use the following example.
`javascript
import formatTime from "../formatTime";
const formattedReleaseTime = formatTime(releaseTime, req.user.timezone);
``