![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
timezone-groups
Advanced tools
A JavaScript library to group time zones based on offset (DST-aware), name or region.
timezone-groups
is a versatile NPM package that allows you to effortlessly generate timezone groups in both Node.js and browser environments. It supports multiple date libraries, including the option to create and use custom ones.
Install the package via NPM using the following command:
npm install timezone-groups
groupByOffset
import { groupByOffset } from "timezone-groups/groupByOffset";
import { DateEngine } from "timezone-groups/groupByOffset/strategy/native";
const timeZoneGroups = await groupByOffset({
startDate, // The start reference date to generate the groups (defaults to now).
groupDateRange, // The number of days to consider for the DST groupings (defaults to 365).
dateEngine: new DateEngine(), // The date engine instance used to generate groups. You can use the `createDateEngine` utility to create an engine from any of the supported engine values. Alternatively, a custom date engine instance used to generate groups.
});
console.log(timeZoneGroups);
// Output:
// [
// {
// "labelIdx": [0, ..., 46],
// "tzs": ["America/Anguilla", ..., "America/Tortola"]
// },
// ...
// ]
groupByName
import { groupByName } from "timezone-groups/groupByName";
const timeZoneGroups = await groupByName();
console.log(timeZoneGroups);
// Output:
// [
// {
// "label": "Africa/Abidjan",
// },
// {
// "label": "Africa/Accra",
// },
// ...
// ]
groupByRegion
import { groupByRegion } from "timezone-groups/groupByRegion";
const timeZoneGroups = await groupByRegion();
console.log(timeZoneGroups);
// Output:
// [
// {
// "label": "Africa",
// "tzs": ["Africa/Abidjan", ..., "Africa/Windhoek"]
// },
// {
// "label": "America",
// "tzs": ["America/Adak", ..., "America/Yakutat"]
// },
// ...
// ]
Intl.supportedValuesOf("timeZone")
.FAQs
A JavaScript library to group time zones based on offset (DST-aware), name or region.
The npm package timezone-groups receives a total of 11,138 weekly downloads. As such, timezone-groups popularity was classified as popular.
We found that timezone-groups demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.