Registry / productivity / multi-date

multi-date

JSON →
library1.0.1jsnpmunverified

A lightweight JavaScript date formatting and manipulation library providing functions for formatting, date arithmetic (add/subtract days, months, years), calculating differences between dates (days, hours, minutes), and comparing dates. Version 1.0.1 focuses on simplicity with a small API surface (format, customDates, inBetweenDates, compareDates). No external dependencies. Released occasionally; suitable for basic date operations without the overhead of Moment.js or date-fns.

npm install multi-date
INSTALL
IMPORT
SIG · MULTI-DATE
M
multi-date
productivityjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

format
import { format } from 'multi-date'
const format = require('multi-date').formate
Note the typo: README shows 'formate' in some places. Correct named export is 'format'.
customDates
import { customDates } from 'multi-date'
const customDates = require('multi-date').customDates
CommonJS require works, but ensure you destructure the correct export name.
inBetweenDates
import { inBetweenDates } from 'multi-date'
const inBetweenDates = require('multi-date').inBetweenDates
ESM and CJS both supported.
compareDates
import { compareDates } from 'multi-date'
Named export; no default export.

Shows basic usage of format, customDates, inBetweenDates, and compareDates functions with ESM imports.

import { format, customDates, inBetweenDates } from 'multi-date'; const now = new Date(); const formatted = format(now, 'DD-MM-YYYY'); console.log(formatted); // e.g., 19-03-2022 const nextMonth = customDates(now, 1, 'month'); console.log(format(nextMonth, 'DD-MM-YYYY')); const diff = inBetweenDates('2022-10-10', '2022-10-15', 'days'); console.log(diff); // 5 Days const c = compareDates('2022-10-10', '2022-10-15'); console.log(c); // -1 (date1 less than date2)
Debug
Known issues
gotchaExport typo: README mentions 'formate' instead of 'format' in some places.
fix
Always import 'format' (not 'formate') from 'multi-date'.
affects: >=1.0.0
gotchacustomDates accepts string dates but does not validate ISO format; ambiguous dates may fail.
fix
Pass Date objects or ISO strings (YYYY-MM-DD) to avoid parsing issues.
affects: >=1.0.0
breakinginBetweenDates returns strings with unit suffix (e.g., '5 Days' ). May break code expecting numbers.
fix
Parse the result with parseInt() if you need a numeric value.
affects: >=1.0.0
deprecatedPackage is low maintenance; no updates since initial release.
fix
Consider using date-fns or dayjs for more active support.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'multi-date'
Package not installed or import path incorrect.
fix
Run 'npm install multi-date' and ensure import/require path is correct.
format is not a function
Imported 'formate' (typo) or used wrong import style.
fix
Use 'import { format } from 'multi-date'' or 'const { format } = require('multi-date')'.
customDates is not a function
Incorrect destructuring or require.
fix
Ensure you use the named export 'customDates'.
Expected a date string or Date object
Passed undefined or non-date value to a function.
fix
Always provide valid Date objects or ISO date strings.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
multi-date — npm install multi-date · libregistry