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 🙏

© 2024 – Pkg Stats / Ryan Hefner

pasoonate

v1.2.8

Published

DateTime helpers and convert to calendars.

Downloads

54

Readme

pasoonate-js

Pasoonate is a library that includes date-time methods and calendars.

Install with npm: npm install pasoonate

const now = Pasoonate.make();
now.gregorian().format('yyyy-MM-dd'); //2019-04-19
let datetime = now.jalali('1398/02/01 20:00:00').gregorian().getDateTime();

Available calendars

  • Gregorian
  • Jalali
  • Islamic
  • Shia

Basic methods

  • getTimestamp()
  • getTimezoneOffset()
  • getDatetime()
  • getDate()
  • getTime()
  • getYear()
  • getMonth()
  • getDay()
  • getHour()
  • getMinute()
  • getSecond()
  • getUTCDatetime()
  • getUTCDate()
  • getUTCTime()
  • getUTCYear()
  • getUTCMonth()
  • getUTCDay()
  • getUTCHour()
  • getUTCMinute()
  • getUTCSecond()
  • setTimestamp(timestampAsSeconds)
  • setTimezoneOffset(offsetAsMinutes)
  • setDatetime(year, month, day, hour, minute, second)
  • setDate(year, month, day)
  • setTime(hour, minute, second)
  • setYear(year)
  • setMonth(month)
  • setDay(day)
  • setHour(hour)
  • setMinute(minute)
  • setSecond(second)
  • setUTCDatetime(year, month, day, hour, minute, second)
  • setUTCDate(year, month, day)
  • setUTCTime(hour, minute, second)
  • setUTCYear(year)
  • setUTCMonth(month)
  • setUTCDay(day)
  • setUTCHour(hour)
  • setUTCMinute(minute)
  • setUTCSecond(second)
  • dayOfWeek() from 0 saturday to 6 friday
  • dayOfYear()
  • weekOfMonth()
  • weekOfYear()

Addition and Substraction Methods

Add Year

today.jalali('1399/01/15 11:22:00').addYear(1).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/01/15 11:22:00

Add Month

today.jalali().addMonth(1).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/02/15 11:22:00

Add Day

today.jalali().addDay(3).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/02/18 11:22:00

Add Hour

today.jalali().addHour(4).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/02/18 15:22:00

Add Minute

today.jalali().addMinute(2).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/02/18 15:24:00

Add Second

today.jalali().addSecond(35).format('yyyy/MM/dd hh:mm:ss'); 
// 1400/02/18 15:24:35

Sub Year

today.jalali().subYear(1).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/02/18 15:24:35

Sub Month

today.jalali().subMonth(1).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/18 15:24:35

Sub Day

today.jalali().subDay(3).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 15:24:35

Sub Hour

today.jalali().subHour(4).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 11:24:35

Sub Minute

today.jalali().subMinute(2).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 11:22:35

Sub Second

today.jalali().subSecond(35).format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 11:22:00

Modifier Methods

Start Of Day

Set time 00:00:00 of the day.

today.jalali('1399/01/15 11:22:00').startOfDay().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 00:00:00

End Of Day

Set time 23:59:59 of the day.

today.jalali('1399/01/15 11:22:00').endOfDay().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 23:59:59

Start Of Week

Sets the Saturday of the same week and set time as 00:00:00.

today.jalali('1399/01/15 11:22:00').startOfWeek().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/09 00:00:00

End Of Week

Set the Friday of the same week and set time as 23:59:59.

today.jalali('1399/01/15 11:22:00').endOfWeek().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/15 23:59:59

Start Of Month

Set day to 1 of the month and set time as 00:00:00.

today.jalali('1399/01/15 11:22:00').startOfMonth().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/01 00:00:00

End Of Month

Set day to latest day of the month and set time as 23:59:59.

today.jalali('1399/01/15 11:22:00').endOfMonth().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/31 23:59:59

Start Of Year

Sets the day and the month to 1 of the year and set time as 00:00:00.

today.jalali('1399/01/15 11:22:00').startOfYear().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/01/01 00:00:00

End Of Year

Set day to latest day of the year and set time as 23:59:59.

today.jalali('1399/01/15 11:22:00').endOfYear().format('yyyy/MM/dd hh:mm:ss'); 
// 1399/12/30 23:59:59