Git Product home page Git Product logo

fable-tzdb's Introduction

Fable.TZDB

This is a Fable wrapper for the tzdb library.

Usage

  1. Add the nuget package Fable.TZDB, e.g. using paket as a dotnet tool:

    dotnet paket add Fable.TZDB -p <your fable project>.fsproj
    
  2. Add the npm dependency, e.g.:

    npm add @vvo/tzdb
    
  3. In your F# source file open the namespace:

    open Fable.TZDB
    
  4. Use the tzdb object:

    let timeZones = tzdb.getTimeZones()
    let tz = timeZones |> Array.find (fun x -> x.name = "Europe/Rome")
    console.log(tz)
    

    the code above generates an output similar to:

    {name: 'Europe/Rome', alternativeName: 'Central European Time', group: Array(1), continentCode: 'EU', continentName: 'Europe', …}
    abbreviation: "CET"
    alternativeName: "Central European Time"
    continentCode: "EU"
    continentName: "Europe"
    countryCode: "IT"
    countryName: "Italy"
    currentTimeFormat: "+02:00 Central European Time - Rome, Milan, Naples, Turin"
    currentTimeOffsetInMinutes: 120
    group: ['Europe/Rome']
    mainCities: (4) ['Rome', 'Milan', 'Naples', 'Turin']
    name: "Europe/Rome"
    rawFormat: "+01:00 Central European Time - Rome, Milan, Naples, Turin"
    rawOffsetInMinutes: 60
    [[Prototype]]: Object
    

Create the package

To create the package in debug mode (used by the example) just issue on the command line:

dotnet pack

To create the package in release mode:

dotnet pack -c Release

Example

A working example can be found in the example directory. Refer to its README file for further informations.

fable-tzdb's People

Contributors

avalente avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.