@robert.tools/eleventy-filter-pretty-date
v1.1.0
Published
Filter to beautify the date string
Maintainers
Readme
🗂️ @robert.tools/eleventy-filter-pretty-date
Filter to beautify the date string according to ISO 8601.
📜 Usage
🟢 Installation
npm install @robert.tools/eleventy-filter-pretty-date📝 Sample usage
import prettyDate from '@robert.tools/eleventy-filter-pretty-date';
prettyDate('2026-10-02', 'MMMM yyyy'); // 'October 2026'
prettyDate('2026-10-02', 'MMM yyyy', 'de-DE'); // 'Okt 2026'
// handling timestamps
prettyDate('1688945499038'); //result: '2023-07-10'
// handling keywords
prettyDate('today'); //result: '2026-09-02'
prettyDate('now'); //result: '2026-09-02'sample: 2026-09-02
- year:
yy(26) oryyyy(2026) - month:
M(9) orMM(09) orMMM(Sep) orMMMM(September) - day:
d(2) ordd(02) orddd(Thu) ordddd(Thursday)
🗃️ commands
After an npm install with npm i the following commands are available:
- initialize placeholders:
npm run init <semantic> - release a new version:
npm run release <semantic>
⚖️ Notes
This software is hand-crafted, test-driven and assisted by AI tools. I know each line of my code. ✌️
| Tool | Comment | | ------------- | ------------- | | | Test-driven development with Jest | | | Part of the robert.tools ecosystem | | | Code completion | | | chatGPT research |
