npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@savvycal/appointments-utils

v0.1.0

Published

JavaScript/TypeScript utilities for the SavvyCal Appointments components

Readme

@savvycal/appointments-utils

Timezone-aware date/time utilities for the SavvyCal Appointments components, built on the TC39 Temporal API.

Installation

npm install @savvycal/appointments-utils

API Reference

startOfMonth(date)

Gets the first day of the month for a given date.

import { startOfMonth } from "@savvycal/appointments-utils";

startOfMonth(new Date("2025-12-15"));
// Date object representing 2025-12-01

endOfMonth(date)

Gets the last day of the month for a given date.

import { endOfMonth } from "@savvycal/appointments-utils";

endOfMonth(new Date("2025-12-15"));
// Date object representing 2025-12-31

toISODate(date)

Converts a date to an ISO date string (YYYY-MM-DD).

import { toISODate } from "@savvycal/appointments-utils";

toISODate(new Date("2025-12-04T14:30:00Z"));
// "2025-12-04"

toISODate(1733324400000); // Unix timestamp in milliseconds
// "2025-12-04"

toISODate("2025-12-04T14:30:00Z");
// "2025-12-04"

toISONaiveDateTime(date, timeZone)

Converts a date to a naive datetime string (without timezone info) in the specified timezone.

import { toISONaiveDateTime } from "@savvycal/appointments-utils";

toISONaiveDateTime(new Date("2025-12-04T19:22:00Z"), "America/New_York");
// "2025-12-04T14:22:00"

formatDate(date, options)

Formats a date for display using Intl.DateTimeFormat.

import { formatDate } from "@savvycal/appointments-utils";

formatDate(new Date(), { day: "numeric", month: "long", weekday: "long" });
// "Thursday, December 4"

formatDate(new Date(), { month: "short", year: "numeric" });
// "Dec 2025"

fromUnixTime(timestamp)

Converts a Unix timestamp (in seconds) to a Date object.

import { fromUnixTime } from "@savvycal/appointments-utils";

fromUnixTime(1733324400);
// Date object representing 2025-12-04T14:00:00Z

getBrowserTimeZone()

Gets the browser's current timezone.

import { getBrowserTimeZone } from "@savvycal/appointments-utils";

getBrowserTimeZone();
// "America/New_York"

getTimeZoneDisplayName(timeZone)

Gets a human-readable display name for a timezone.

import { getTimeZoneDisplayName } from "@savvycal/appointments-utils";

getTimeZoneDisplayName("America/New_York");
// "Eastern Standard Time"

getTimeZoneDisplayName("Europe/London");
// "Greenwich Mean Time"

isSameDay(date1, date2, timeZone)

Checks if two dates fall on the same calendar day in the specified timezone.

import { isSameDay } from "@savvycal/appointments-utils";

// These are the same day in Eastern time (both Dec 4)
isSameDay(
  new Date("2025-12-04T23:00:00Z"),
  new Date("2025-12-05T01:00:00Z"),
  "America/New_York",
);
// true

// But different days in UTC
isSameDay(
  new Date("2025-12-04T23:00:00Z"),
  new Date("2025-12-05T01:00:00Z"),
  "UTC",
);
// false

License

MIT