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

@craftthingy-digital-innovation/cty-date-indo-utils

v1.0.2

Published

Isomorphic Indonesian date formatting, conversions, validation, and auto-slash input masking.

Downloads

418

Readme

@craftthingy-digital-innovation/cty-date-indo-utils-web

Bilingual documentation: Bahasa Indonesia | English


Bahasa Indonesia

Library client-side Javascript untuk memformat tanggal Indonesia (DD/MM/YYYY), mengubah ke format database (YYYY-MM-DD), memvalidasi tanggal kalender secara akurat (termasuk tahun kabisat), serta melakukan pembatasan input teks keyboard (date masking "HH/BB/TTTT").

Sangat berguna untuk standarisasi format tanggal Indonesia di berbagai form input aplikasi web Anda.

Instalasi

npm install @craftthingy-digital-innovation/cty-date-indo-utils-web

Cara Penggunaan

import { 
  formatDateIndo, 
  convertDateToDb, 
  maskDateInput, 
  isValidDateIndo 
} from '@craftthingy-digital-innovation/cty-date-indo-utils-web';

// 1. Ubah database YYYY-MM-DD ke Indonesia DD/MM/YYYY
formatDateIndo('2026-07-03'); // Output: '03/07/2026'

// 2. Ubah database ke format tanggal lisan (Long Format)
formatDateIndo('2026-07-03', true); // Output: '03 Juli 2026'

// 3. Ubah input Indonesia DD/MM/YYYY kembali ke format database YYYY-MM-DD
convertDateToDb('03/07/2026'); // Output: '2026-07-03'

// 4. Validasi kebenaran kalender tanggal Indonesia (termasuk kabisat)
isValidDateIndo('29/02/2026'); // Output: false (2026 bukan tahun kabisat)
isValidDateIndo('29/02/2024'); // Output: true (2024 adalah tahun kabisat)

// 5. Pasang pembatas karakter ketik otomatis (Date Input Masking) pada input HTML
const myDateInput = document.getElementById('tanggal-lahir');
maskDateInput(myDateInput); // Otomatis menambahkan "/" saat diketik & hanya menerima angka

English

A client-side JavaScript utility to format Indonesian dates (DD/MM/YYYY), convert them back to database formats (YYYY-MM-DD), validate calendar dates precisely (including leap years), and restrict text inputs (date masking "DD/MM/YYYY").

Perfect for standardizing Indonesian date entries across your web applications.

Installation

npm install @craftthingy-digital-innovation/cty-date-indo-utils-web

Usage

import { 
  formatDateIndo, 
  convertDateToDb, 
  maskDateInput, 
  isValidDateIndo 
} from '@craftthingy-digital-innovation/cty-date-indo-utils-web';

// 1. Format database YYYY-MM-DD to Indonesian DD/MM/YYYY
formatDateIndo('2026-07-03'); // Returns: '03/07/2026'

// 2. Format to verbose/long format name
formatDateIndo('2026-07-03', true); // Returns: '03 Juli 2026'

// 3. Convert Indonesian entry back to YYYY-MM-DD database format
convertDateToDb('03/07/2026'); // Returns: '2026-07-03'

// 4. Validate calendar dates (handles leap years)
isValidDateIndo('29/02/2026'); // Returns: false (2026 is not a leap year)
isValidDateIndo('29/02/2024'); // Returns: true (2024 is a leap year)

// 5. Restrict typing input with auto-slash masking
const myDateInput = document.getElementById('birthdate');
maskDateInput(myDateInput); // Restricts to numbers and inserts "/" automatically