New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

back-in-time

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

back-in-time

years to travel and print past dates

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Introduction

A versatile JavaScript library for simplified historical date. "back-in-time" provides an intuitive module that allows developers to effortlessly retrieve past dates from previous years and obtain them in an array with customizable formatting.

Key Features:

- Date Generation: Easily generate past dates by specifying the number of years ago.

-Custom Formatting: Format the output dates according to your application's requirements.

-Date Array: Retrieve dates in an array, enabling efficient batch processing.

-Lightweight: Keep your project dependencies minimal with a lightweight and efficient utility.

About Package ?

backInTime(currentDate, yearsToBack, dateFormat);

Installation

npm install back-in-time

Parameters

NameTypeDefaultDescription
currentDateString-currentDate paramete is required, this parameter will ensure that from which date you want to reverse to
yearsToBackString-yearsToBack paramete is required, this parameter will behave like end date where you want to stop
dateFormatStringYYYY-MM-DDdateFormat paramete is Optional, with the help of this parameter you can decide you date fromat when you get output

Usage

const { backInTime } = require("back-in-time");

const dates = backInTime("2024-01-01", "2022-01-01");
console.log(dates)

Expected Output

[
  '2022-01-01', '2022-02-01',
  '2022-03-01', '2022-04-01',
  '2022-05-01', '2022-06-01',
  '2022-07-01', '2022-08-01',
  '2022-09-01', '2022-10-01',
  '2022-11-01', '2022-12-01',
  '2023-01-01', '2023-02-01',
  '2023-03-01', '2023-04-01',
  '2023-05-01', '2023-06-01',
  '2023-07-01', '2023-08-01',
  '2023-09-01', '2023-10-01',
  '2023-11-01', '2023-12-01',
  '2024-01-01'
]

Supported Date Formats

Format CodeDate
MMMM Do YYYYJanuary 21st 2024
YYYY/MM/DD2024/01/21
D MMM, YYYY21 Jan, 2024
dddd, MMMM Do YYYYSunday, January 21st 2024
ddd, MMM D YYYYSun, Jan 21 2024
MMMM D, YYYYJanuary 21, 2024
ddd, MMMM D YYYYSun, January 21 2024
YYYY-MM-DD2024-01-21

Keywords

back-in-time

FAQs

Package last updated on 21 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts