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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ti7112/date-time-handler

v1.0.5

Published

import { DateHandler } from "@ti7112/date-time-handler";

Downloads

7

Readme

import { DateHandler } from "@ti7112/date-time-handler";

Date Utilities Module

This is a simple JavaScript module that provides utility functions for working with dates. It offers two primary functions:

  1. DateHandler.now() - Returns the current date and time.
  2. DateHandler.detail(bufferDate) - Accepts a specific date as input (in Date format) and returns detailed information about the date, such as the day of the week, the name of the month, the number of days in the month, and the year. Table of Contents
  • Installation
  • Usage o now() o detail()
  • Example
  • License Installation To use this module, you can either download the file directly or use a package manager like npm or yarn. If you're including the module directly in your project, save the JavaScript file as date-utils.js (or another name of your choosing) and import it into your code. For Node.js projects, you can install it by linking the module into your project directory.

Usage DateHandler.now() The DateHandler.now() function returns the current date and time as a Date object. Javascript

DateHandler.detail("Y-m-d") The DateHandler.detail("Y-m-d") function accepts a Date object or a date string, and returns a detailed object with information about the given date, such as:

  • The day of the week (0-6).
  • The day name (e.g., "sunday").
  • The date of the month (1-31).
  • The month number (0-11).
  • The month name (e.g., "January").
  • The number of days in the month.
  • The year.

Parameters for DateHandler.detail():

  • bufferDate: A Date object or a date string (e.g., '2024-12-30' or '2024-12-01T00:00:00Z'). If no date is provided, it defaults to the current date.

Explanation of the Code

  • days: An array that contains the names of the days of the week.
  • months: An array that contains the names of the months of the year.
  • now(): Returns the current Date object representing the current date and time.
  • detail("Y-m-d"): Takes a Date object or a date string and returns an object with detailed information about the given date: o day: The day of the week (from 0 for Sunday to 6 for Saturday). o dayName: The name of the day (e.g., "sunday", "monday"). o date: The day of the month (1-31). o month: The index of the month (0-11). o monthName: The name of the month (e.g., "January", "February"). o noOfDays: The number of days in the specified month. o year: The year of the provided date.

This module is useful for projects that need to manipulate or display date-related information in a structured format. You can easily extend it by adding more date-related methods or integrating it into larger applications.