Skip to content

Latest commit

 

History

History
executable file
·
40 lines (31 loc) · 1.68 KB

README.md

File metadata and controls

executable file
·
40 lines (31 loc) · 1.68 KB

Fable.DateFunctions Build Status Build status Nuget

Fable binding for the popular date-fns, 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.

Installation Using Femto

Using 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

open Fable.DateFunctions

let 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.