https://github.com/kukimik/dhall-date-format
Utilities for formatting dates in the Dhall configuration language.
https://github.com/kukimik/dhall-date-format
date dhall-lang formatting
Last synced: 2 months ago
JSON representation
Utilities for formatting dates in the Dhall configuration language.
- Host: GitHub
- URL: https://github.com/kukimik/dhall-date-format
- Owner: kukimik
- License: unlicense
- Created: 2024-06-13T12:27:20.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-06-13T12:42:10.000Z (11 months ago)
- Last Synced: 2025-01-19T13:43:44.238Z (4 months ago)
- Topics: date, dhall-lang, formatting
- Language: Dhall
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Utilities for formatting `Date`s as `Text` in the [Dhall](https://dhall-lang.org/)
configuration language.## Usage example
```dhall
let DF = ./src/package.dhall
let F = DF.Formatsin
[DF.format F.`MM.DD.YYYY` 1991-09-17
,DF.format F.`the Dth of MMMM, YYYY` 1990-04-01
,DF.format (DF.mask "D@MMMM[YY]") 1970-01-01
]
```evaluates to
```dhall
[ "09.17.1991", "the 1st of April, 1990", "1@January[70]" ]
```## Available formats
The formats provided by the library all live in `./src/Formats/package.dhall`.
It is easy to implement your own format; see the source code of the existing
formats and proceed analogously. You may also use `./src/mask.dhall` to create
a simple format using a `Text` mask.