Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firstandthird/datefmt
Javascript date and time formatter
https://github.com/firstandthird/datefmt
Last synced: 3 days ago
JSON representation
Javascript date and time formatter
- Host: GitHub
- URL: https://github.com/firstandthird/datefmt
- Owner: firstandthird
- License: mit
- Created: 2013-12-10T22:10:12.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T11:22:51.000Z (about 6 years ago)
- Last Synced: 2025-01-10T18:02:06.858Z (12 days ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#datefmt
Date format lib
### Usage
Uses php style date format.
```javascript
const date = new Date(2013, 4, 8);
datefmt('%j %D %l', date); // 8 Wed Wednesday
``````javascript
const date = new Date(2013, 0, 6);
const months = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'];
const days = ['Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo'];datefmt.translate(months, days);
datefmt('%F', date); //Enero
datefmt('%l', date); //Lunes
```