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

alegrify-date

v1.0.11

Published

Pure JS Date library

Readme

Alegrify Date

Pure JS Date library

Build Status NPM

Install

npm i alegrify-date

or

yarn i alegrify-date

How to use

const AlegrifyDate = require('alegrify-date');

const date = new AlegrifyDate();

// Set year to 2020
date.year = 2020;

// Set month to January
date.month = 'Jarnuary';

// Add one month
date.month++;

// Subtract 3 days
date.day -= 3;

// Add 5 minutes
date.minute = 5;

// Format the date
console.log(date.format('DD MMMM, HHhmm'));

API

Date.prototype

Alegrify Date extends from the Date Object, so every original Date method can be used such as getTime and toString

[Property] second

date.second = 22;
console.log(date.second);

[Property] minute

date.minute = 15;
console.log(date.minute);

[Property] minute

date.hour = 23;
console.log(date.hour);

[Property] day

date.day = 'Monday'; // Set to Monday in the same week
date.day = 16; // Set to the 16th day in the month
console.log(date.day);

[Property] month

date.month = 'Februrary'; // Set date to same day in February
date.month = 3; // Set date to same day in March
console.log(date.month);

[Property] year

date.year = 2017;
console.log(date.year);

[Method] format

Display the date in a certain format

const date = AlegrifyDate('2019-06-03T20:45:00');
return date.format('D MMMM YYYY HH[h]');
// Will return 3 June 2019 20h

| Param | Description | Example | |-------|------------------------|----------| | s | 1 digit second value | 1 2 12 | | ss | 2 digits second value | 01 02 12 | | m | 1 digit minute value | 1 2 12 | | mm | 2 digits minute value | 01 02 12 | | H | 1 digit hour value | 1 2 12 | | HH | 2 digits hour value | 01 02 12 | | D | 1 digit day value | 1 2 12 | | DD | 2 digits day value | 01 02 12 | | Do | Format day with 'Xth' | 2nd 4th | | d | Weekday one digit | Mo = 1 | | dd | Short weekday string | Mo Tu | | ddd | Medium weekday string | Mon Tue | | dddd | Full weekday string | Monday | | dddd | Full weekday string | Monday | | e | Weekday one digit | Su = 0 | | M | Month one digit | Jan = 1 | | MM | Month two digits | Jan = 01 | | MMM | Month short name | Jan Feb | | MMMM | Month full name | January | | Mo | Format month with 'Xth'| Jan = 1st| | YY | Short code year | 2019 = 19| | YYYY | Short code year | 2018 2019|