{"id":41554,"library":"multi-date","title":"multi-date","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","multi-date","moment","date","time","parse","format","validate","i18n"],"install":[{"cmd":"npm install multi-date","lang":"bash","label":"npm"},{"cmd":"yarn add multi-date","lang":"bash","label":"yarn"},{"cmd":"pnpm add multi-date","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Note the typo: README shows 'formate' in some places. Correct named export is 'format'.","wrong":"const format = require('multi-date').formate","symbol":"format","correct":"import { format } from 'multi-date'"},{"note":"CommonJS require works, but ensure you destructure the correct export name.","wrong":"const customDates = require('multi-date').customDates","symbol":"customDates","correct":"import { customDates } from 'multi-date'"},{"note":"ESM and CJS both supported.","wrong":"const inBetweenDates = require('multi-date').inBetweenDates","symbol":"inBetweenDates","correct":"import { inBetweenDates } from 'multi-date'"},{"note":"Named export; no default export.","wrong":null,"symbol":"compareDates","correct":"import { compareDates } from 'multi-date'"}],"quickstart":{"code":"import { format, customDates, inBetweenDates } from 'multi-date';\n\nconst now = new Date();\nconst formatted = format(now, 'DD-MM-YYYY');\nconsole.log(formatted); // e.g., 19-03-2022\n\nconst nextMonth = customDates(now, 1, 'month');\nconsole.log(format(nextMonth, 'DD-MM-YYYY'));\n\nconst diff = inBetweenDates('2022-10-10', '2022-10-15', 'days');\nconsole.log(diff); // 5 Days\n\nconst c = compareDates('2022-10-10', '2022-10-15');\nconsole.log(c); // -1 (date1 less than date2)","lang":"javascript","description":"Shows basic usage of format, customDates, inBetweenDates, and compareDates functions with ESM imports."},"warnings":[{"fix":"Always import 'format' (not 'formate') from 'multi-date'.","message":"Export typo: README mentions 'formate' instead of 'format' in some places.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Pass Date objects or ISO strings (YYYY-MM-DD) to avoid parsing issues.","message":"customDates accepts string dates but does not validate ISO format; ambiguous dates may fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Parse the result with parseInt() if you need a numeric value.","message":"inBetweenDates returns strings with unit suffix (e.g., '5 Days' ). May break code expecting numbers.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider using date-fns or dayjs for more active support.","message":"Package is low maintenance; no updates since initial release.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.1':33 'add/subtract':18 'api':40 'arithmet':17 'basic':53 'calcul':22 'compar':30 'compared':45 'customd':43 'date':3,7,16,25,31,54,63,68,70 'date-fn':62 'day':19,26 'depend':48 'differ':23 'extern':47 'fns':64 'focus':34 'format':8,15,42,73 'function':13 'hour':27 'i18n':75 'inbetweend':44 'javascript':6,65 'librari':11 'lightweight':5 'manipul':10 'minut':28 'moment':69 'moment.js':60 'month':20 'multi':2,67 'multi-d':1,66 'occasion':50 'oper':55 'overhead':58 'pars':72 'provid':12 'releas':49 'simplic':36 'small':39 'suitabl':51 'surfac':41 'time':71 'valid':74 'version':32 'without':56 'year':21","created_at":"2026-06-04T18:52:58.132559+00:00","updated_at":"2026-06-04T18:52:58.132559+00:00","problems":[{"fix":"Run 'npm install multi-date' and ensure import/require path is correct.","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'multi-date'"},{"fix":"Use 'import { format } from 'multi-date'' or 'const { format } = require('multi-date')'.","cause":"Imported 'formate' (typo) or used wrong import style.","error":"format is not a function"},{"fix":"Ensure you use the named export 'customDates'.","cause":"Incorrect destructuring or require.","error":"customDates is not a function"},{"fix":"Always provide valid Date objects or ISO date strings.","cause":"Passed undefined or non-date value to a function.","error":"Expected a date string or Date object"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"multi-date","openapi_spec":null,"status_page":null,"smithery":null,"categories":["productivity"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}