Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Zaid-Ajaj/Fable.DateFunctions
Fable binding for date-fns javascript library, implemented as extension methods for DateTime. See https://zaid-ajaj.github.io/Fable.DateFunctions/
https://github.com/Zaid-Ajaj/Fable.DateFunctions
Last synced: 2 months ago
JSON representation
Fable binding for date-fns javascript library, implemented as extension methods for DateTime. See https://zaid-ajaj.github.io/Fable.DateFunctions/
- Host: GitHub
- URL: https://github.com/Zaid-Ajaj/Fable.DateFunctions
- Owner: Zaid-Ajaj
- License: mit
- Created: 2018-04-14T17:44:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T14:21:21.000Z (over 1 year ago)
- Last Synced: 2024-04-28T23:03:25.610Z (2 months ago)
- Language: F#
- Homepage: https://zaid-ajaj.github.io/Fable.DateFunctions/
- Size: 3.89 MB
- Stars: 26
- Watchers: 3
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-fable - Fable.DateFunctions - binding for the [date-fns](https://date-fns.org/) library, implemented as 120+ extension methods for DateTime. (Libraries)
README
# Fable.DateFunctions [![Build Status](https://travis-ci.org/Zaid-Ajaj/Fable.DateFunctions.svg?branch=master)](https://travis-ci.org/Zaid-Ajaj/Fable.DateFunctions) [![Build status](https://ci.appveyor.com/api/projects/status/od92jraqhec4vbj5?svg=true)](https://ci.appveyor.com/project/Zaid-Ajaj/fable-datefunctions) [![Nuget](https://img.shields.io/nuget/v/Fable.DateFunctions.svg?maxAge=0&colorB=brightgreen)](https://www.nuget.org/packages/Fable.DateFunctions)
Fable binding for the popular [date-fns](https://date-fns.org/), a library for date manipulation. This binding implements the imports as 120+ extension methods for `DateTime` and `DateTimeOffset` instances. 32 Languages are supported for formatting dates, see [live docs](https://zaid-ajaj.github.io/Fable.DateFunctions/).
## Installation Using Femto
Using [Femto](https://github.com/Zaid-Ajaj/Femto) you can install the library and its npm dependency in one go:
```
femto install Fable.DateFunctions
```## Installation
Install the binding from Nuget
```
paket add Fable.DateFunctions --project path/to/Proj.fsproj
```
Install the actual Javascript library `date-fns` from npm
```
npm install [email protected]
```
Now from your F# code
```fs
open Fable.DateFunctionslet now = DateTime.Now
now.SubtractDays(1).IsInThePast() // true
```## Todo (PRs are welcome)
- ISO Week-Numbering Year Helpers
- More docs
- Better tree-shaking (lazy imports, i.e. only import what you use)## Build and running the app
1. Start Fable server and Webpack dev server: `./build.sh Watch`
2. In your browser, open: http://localhost:8080/Any modification you do to the F# code will be reflected in the web page after
saving.