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 🙏

© 2024 – Pkg Stats / Ryan Hefner

masa

v0.3.0

Published

small library to format date in Indonesian language

Downloads

10

Readme

masa

masa is a small javascript library to format date in Indonesian language. It takes inspiration from momentjs, but a lot smaller and with specific functionality for date formatting in Bahasa Indonesia.

masa adalah pustaka javascript sederhana untuk memformat tanggal dalam bahasa Indonesia. Pustaka ini mengambil inspirasi dari momentjs, namun ukurannya jauh lebih kecil dengan fungsi spesifik untuk memformat tanggal.

Kenapa pustaka ini dibuat?

Memformat tanggal adalah hal yang cukup sering dilakukan oleh para developer, terutama frontend developer. Solusi yang sudah ada dan mungkin paling dikenal adalah momentjs. Namun rasanya jika hanya sekedar untuk memformat tanggal, pustaka momentjs terlalu besar karena saking lengkapnya fitur yang tersedia, dan tentu saja ini akan menambah ukuran bundle aplikasi secara tidak perlu.

Cara Penggunaan

npm install masa
import { masa } from 'masa';

// menampilkan tanggal hari ini dengan format default `D MMMM YYYY`
masa().format(); // 17 Agustus 2020
masa(new Date()).format(); // 17 Agustus 2020

masa('2020-02-02').format('D/M/YY'); // 2/2/20

masa(new Date('2020-11-15')).format('[hari] dddd, [tanggal] D MMMM YYYY'); // hari Minggu, tanggal 15 November 2020

| | Token | Output | | ------: | ----- | ----------------------------------------------- | | Hari | dd | Mg Sn Sl Rb Km Jm Sb | | | ddd | Min Sen Sel Rab Kam Jum Sab | | | dddd | Minggu Senin Selasa Rabu Kamis Jumat Sabtu | | Tanggal | D | 1 2 3 ... 30 31 | | | DD | 01 02 03 ... 30 31 | | Bulan | M | 1 2 3 ... 11 12 | | | MM | 01 02 03 ... 11 12 | | | MMM | Jan Feb Mar Apr Mei Jun Jul Agt Sep Okt Nov Des | | | MMMM | Januari Februari Maret ... November Desember | | Tahun | YY | 98 99 19 20 | | | YYYY | 1998 1999 2019 2020 1999 | | Jam | H | 0 1 2 ... 22 23 | | | HH | 00 01 02 ... 22 23 | | Menit | m | 0 1 2 ... 58 59 | | | mm | 00 01 02 ... 58 59 | | Detik | s | 0 1 2 ... 58 59 | | | ss | 00 01 02 ... 58 59 |

Untuk kata yang ingin disisipkan kepada output bisa dimasukkan kedalam string format dengan diapit kurung siku, misal [hari] dddd, [tanggal] D [bulan] MMMM [tahun] YYYY