1.0.0-a • Published 1 year ago

date_conversion_js v1.0.0-a

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Project Title

Date Conversion

Description

A light weight utility package for simple date conversion in javascript.

Installation

Describe the installation process. Include any prerequisites, such as required libraries or tools.

git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
npm install

Documentation

Function NameDescriptionInputOutputExampleNotes
dateAndMonthExtracts the date and month from a string in ISO format.String in ISO format (e.g., 2024-02-14)String with date and month (e.g., 14 Feb)dateAndMonth("2024-02-14")Throws error if invalid format.
minutesToHoursConverts minutes to hours (integer part only).Number of minutesNumber of hoursminutesToHours(120)
dateMonthNameYearCommaSeperatedFormats a string in ISO format to "date, month name year" with comma separation.String in ISO format (e.g., 2024-02-14)String with formatted date (e.g., 14, Feb 2024)dateMonthNameYearCommaSeperated("2024-02-14")Throws error if invalid format.
datediffCalculates the difference between a given date and the current date in days (rounded).String in ISO format (e.g., 2024-02-15)Number of days differencedatediff("2024-02-15")Throws error if invalid format.
dateAndMonthNameCommaSeperatedFormats a date string to "date, month name" with comma separation.String in "YYYY-MM" format (e.g., 2024-02)String with formatted date (e.g., 02, Feb)dateAndMonthNameCommaSeperated("2024-02")
convertToISTConverts a date string in UTC to IST time with hours:minutes and AM/PM format.String in any date format (e.g., 2024-02-14T12:00:00)String with IST time (e.g., 12:30 PM).convertToIST("2024-02-14T12:00:00")Undefined if invalid format.
dayDateandMonthNameFormats a date string to "Day, date month name".String in any date format (e.g., 2024-02-14)String with formatted date (e.g., Wed, 14 Feb)dayDateandMonthName("2024-02-14")
dayMonthNameAndDateFormats a date string to "Date month name, Day".String in any date format (e.g., 2024-02-14)String with formatted date (e.g., 14 Feb, WED)dayMonthNameAndDate("2024-02-14")