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 🙏

© 2026 – Pkg Stats / Ryan Hefner

date-fns-mr

v1.0.3

Published

Marathi (mr) locale support for date-fns with Marathi digits and grammar enhancements

Readme

date-fns Marathi Locale

npm version License: MIT

Complete Marathi (मराठी) locale for date-fns with native Devanagari script support, including Marathi digits (०-९).

Features

✅ Full Marathi translations for months, days, and time periods
✅ Native Marathi (Devanagari) digit conversion (०-९)
✅ Support for short and abbreviated formats
✅ Distance and relative time formatting
✅ Proper ordinal number handling
✅ TypeScript support with full type safety
✅ Zero dependencies (except date-fns peer dependency)

Installation

npm install date-fns date-fns-mr

or with yarn:

yarn add date-fns date-fns-mr

or with pnpm:

pnpm add date-fns date-fns-mr

Usage

Basic Date Formatting

import { format } from "date-fns";
import { marathiLocale } from "date-fns-mr";

const date = new Date(2025, 9, 24); // October 24, 2025

// Full date with month name
format(date, "d MMMM yyyy", { locale: marathiLocale });
// Output: "२४ ऑक्टोबर २०२५"

// Short date
format(date, "d MMM yyyy", { locale: marathiLocale });
// Output: "२४ ऑक्टो २०२५"

// Full date with day name
format(date, "EEEE, d MMMM yyyy", { locale: marathiLocale });
// Output: "शुक्रवार, २४ ऑक्टोबर २०२५"

// Short day name
format(date, "EEE, d MMM", { locale: marathiLocale });
// Output: "शुक्र, २४ ऑक्टो"

Time Formatting

import { format } from "date-fns";
import { marathiLocale } from "date-fns-mr";

const date = new Date(2025, 9, 24, 14, 30);

// 24-hour format
format(date, "HH:mm", { locale: marathiLocale });
// Output: "१४:३०"

// With day period
format(date, "h:mm a", { locale: marathiLocale });
// Output: "२:३० संध्याकाळी"

// Full date and time
format(date, "d MMMM yyyy 'रोजी' HH:mm", { locale: marathiLocale });
// Output: "२४ ऑक्टोबर २०२५ रोजी १४:३०"

Distance Formatting

import { formatDistance, formatDistanceToNow } from "date-fns";
import { marathiLocale } from "date-fns-mr";

const pastDate = new Date(2025, 9, 20);
const futureDate = new Date(2025, 9, 28);

// Distance from past
formatDistance(pastDate, new Date(2025, 9, 24), {
  locale: marathiLocale,
  addSuffix: true,
});
// Output: "४ दिवस पूर्वी"

// Distance to future
formatDistance(futureDate, new Date(2025, 9, 24), {
  locale: marathiLocale,
  addSuffix: true,
});
// Output: "४ दिवस मध्ये"

// Distance to now
formatDistanceToNow(pastDate, {
  locale: marathiLocale,
  addSuffix: true,
});
// Output: "४ दिवस पूर्वी"

Relative Time Formatting

import { formatRelative } from "date-fns";
import { marathiLocale } from "date-fns-mr";

const baseDate = new Date(2025, 9, 24);

// Yesterday
formatRelative(new Date(2025, 9, 23), baseDate, { locale: marathiLocale });
// Output: "काल"

// Today
formatRelative(new Date(2025, 9, 24), baseDate, { locale: marathiLocale });
// Output: "आज"

// Tomorrow
formatRelative(new Date(2025, 9, 25), baseDate, { locale: marathiLocale });
// Output: "उद्या"

Parsing Dates

import { parse } from "date-fns";
import { marathiLocale } from "date-fns-mr";

// Parse Marathi date string
const date = parse("२४ ऑक्टोबर २०२५", "d MMMM yyyy", new Date(), {
  locale: marathiLocale,
});

console.log(date); // Date object: October 24, 2025

TypeScript Support

This package is written in TypeScript and provides full type definitions:

import { Locale } from "date-fns";
import { marathiLocale } from "date-fns-mr";

// marathiLocale is properly typed as Locale
const locale: Locale = marathiLocale;

Locale Options

The Marathi locale includes the following configurations:

  • Week starts on: Monday (1)
  • First week contains date: 1
  • Digits: Native Marathi digits (०-९)

Format Tokens

Common Format Tokens

| Token | Description | Example Output | | ------ | ----------------------- | -------------- | | d | Day of month | २४ | | dd | Day of month (2 digits) | २४ | | E | Day of week (short) | शुक्र | | EEEE | Day of week (full) | शुक्रवार | | M | Month | १० | | MM | Month (2 digits) | १० | | MMM | Month (short) | ऑक्टो | | MMMM | Month (full) | ऑक्टोबर | | yyyy | Year | २०२५ | | HH | Hour (24h) | १४ | | mm | Minute | ३० | | ss | Second | ४५ | | a | Day period | संध्याकाळी |

Translations Reference

Months (महिने)

Full: जानेवारी, फेब्रुवारी, मार्च, एप्रिल, मे, जून, जुलै, ऑगस्ट, सप्टेंबर, ऑक्टोबर, नोव्हेंबर, डिसेंबर

Short: जाने, फेब्रु, मार्च, एप्रि, मे, जून, जुलै, ऑग, सप्टे, ऑक्टो, नोव्हें, डिसें

Days (दिवस)

Full: रविवार, सोमवार, मंगळवार, बुधवार, गुरुवार, शुक्रवार, शनिवार

Short: रवि, सोम, मंगळ, बुध, गुरु, शुक्र, शनि

Narrow: र, सो, मं, बु, गु, शु, श

Day Periods

  • AM: सकाळी (sakāḷī)
  • PM: संध्याकाळी (sandhyākāḷī)
  • Midnight: मध्यरात्र (madhyarātra)
  • Noon: दुपार (dupāra)

Browser Support

This package supports all modern browsers and Node.js environments that are supported by date-fns.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/improvement)
  3. Commit your changes (git commit -am 'Add some improvement')
  4. Push to the branch (git push origin feature/improvement)
  5. Open a Pull Request

Reporting Issues

Please report any bugs or translation inaccuracies by opening an issue on GitHub.

Development

# Install dependencies
npm install

# Build
npm run build

License

MIT © Mahesh Rathod

Acknowledgments

  • Built for date-fns
  • Inspired by other date-fns locale packages
  • Translations follow standard Marathi language conventions

Related Packages

  • date-fns - Modern JavaScript date utility library

Support

If you find this package helpful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting bugs
  • 💡 Suggesting improvements
  • 📖 Improving documentation

Keywords

date-fns, marathi, locale, localization, i18n, internationalization, devanagari, marathi-language, date-formatting, time-formatting, typescript, javascript, date-utility, marathi-digits, indian-languages, regional-language, date-parser, date-manipulation, npm-package, frontend, backend, node, browser


Made with ❤️ for the Marathi-speaking community