Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svozza/sanctuary-date-poc
https://github.com/svozza/sanctuary-date-poc
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/svozza/sanctuary-date-poc
- Owner: svozza
- Created: 2016-01-16T13:43:18.000Z (almost 9 years ago)
- Default Branch: everything
- Last Pushed: 2016-02-02T20:41:28.000Z (almost 9 years ago)
- Last Synced: 2024-06-26T01:21:22.603Z (5 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A proof of concept for a type safe version of [**date-fp**](https://github.com/cullophid/date-fp)
that returns an `Either` if an operation results in an invalid date. Run time type checking
is provided by [**sanctuary-def**](https://github.com/plaid/sanctuary-def). All
types except `TimeUnit` are defined [there](https://github.com/plaid/sanctuary-def#types).## Functions:
### add :: TimeUnit -> Integer -> ValidDate -> Either String ValidDate
### convertTo :: TimeUnit -> ValidDate -> ValidNumber
### diff :: TimeUnit -> ValidDate -> ValidDate -> Integer
### equals :: ValidDate -> ValidDate -> Boolean
### get :: TimeUnit -> ValidDate -> Integer
### isLeapYear :: ValidDate -> Boolean
### isValid :: Any -> Boolean
### min :: [ValidDate] -> ValidDate
### max :: [ValidDate] -> ValidDate
### parse :: String -> String -> Either String ValidDate
### set :: TimeUnit -> Integer -> ValidDate -> Either String ValidDate
### unixTime :: ValidDate -> Integer