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

@aftabmk/date

v1.0.11

Published

This package provide date with specific format using 'ampersand','apostrophe','asterisk','atSign','dot','dollar','hyphen','underScore','exclamation','hash','quotation'and 'forwardSlash'.This package can also provide date format of today,week ago,month ago

Downloads

34

Readme

Installing

Using npm:

$ npm install @aftabmk/date

Using bower:

$ bower install @aftabmk/date

Using yarn:

$ yarn add @aftabmk/date

Using pnpm:

$ pnpm add @aftabmk/date

Documentation

Functions

getDate

const date : getDate(number,number,number,boolean,string)

getDateNow

const dateNow : getDateNow(number,number,number,boolean,string)

getEpoch

const epoch : getEpoch(string,string)

getEpochNow

const epoch : getEpoch(null)

getDate inputs

Day(week ago)

const dateNow = getDate(7,0,0,true,'forwardSlash')
// current 10/05/2022
// result 03/05/2022
// logic day = 10-7 = 2

Month(Quarter ago)

const dateNow = getDate(0,3,0,true,'forwardSlash')
// current 02/12/22
// result 02/9/22
// logic day = 12-3 = 9

Year(decade ago)

const dateNow = getDate(0,0,10,true,'forwardSlash')
// current 02/12/22
// result 02/9/12
// logic day = 22-10 = 12

True

const dateNow = getDate(0,0,0,true,'forwardSlash')
// result 01/01/22

False

const dateNow = getDate(0,0,0,false,'forwardSlash')
// result 01/01/2022

Examples of input symbols

Ampersand(&)

const dateNow = getDate(0,0,0,false,'ampersand')
// result 01&01&2022

Apostrophe(')

const dateNow = getDate(0,0,0,false,'apostrophe')
// result 01'01'2022

Asterisk()*

const dateNow = getDate(0,0,0,false,'asterisk')
// result 01*01*2022

AtSign(@)

const dateNow = getDate(0,0,0,false,'atSign')
// result 01@01@2022

Dot(.)

const dateNow = getDate(0,0,0,false,'dot')
// result 01.01.2022

Dollar($)

const dateNow = getDate(0,0,0,false,'dollar')
// result 01$01$2022

Hyphen(-)

const dateNow = getDate(0,0,0,false,'hyphen')
// result 01-01-2022

UnderScore(_)

const dateNow = getDate(0,0,0,false,'underScore')
// result 01_01_2022

Exclamation(!)

const dateNow = getDate(0,0,0,false,'exclamation')
// result 01!01!2022

Hash(#)

const dateNow = getDate(0,0,0,false,'hash')
// result 01#01#2022

Quotation(")

const dateNow = getDate(0,0,0,false,'quotation')
// result 01"01"2022

ForwardSlash(/)

const dateNow = getDate(0,0,0,false,'forwardSlash')
// result 01/01/2022

Starter Code

getDate function

const { getDate } = require('@aftabmk/date');
const date = getDate(0,0,0,false,'forwardSlash')
// date now in the format dd/mm/yyyy
// result 01/01/2022

getDateNow function

const { getDateNow } = require('@aftabmk/date');
const date = getDateNow(false,'forwardSlash')
// date now in the format dd/mm/yyyy
// result 01/01/2022(Today date)

getEpoch function

const { getEpoch } = require('@aftabmk/date');
const date = getEpoch('14/07/2002','12:30')
// date format dd/mm/yyyy
// time format hh:mm
// result 1026630000

getEpochNow function

const { getEpochNow } = require('@aftabmk/date');
const date = getEpochNow()
// no input
// result 1613889000000 in sec