Giter Site home page Giter Site logo

momento's Introduction

Momento

Immutable moment.js with composable functions and partial application of data

Installation

$ npm install momento

Example with Ramda pipe

const nextWeek = pipe(
  parse('DD/MM/YYYY'),
  add('days', 7),
  format('DD/MM/YYYY')
)

nextWeek('10/12/2017')

Functions

add

Same as moment.add()

add('days', 2, now())

format

Same as moment.format()

format('DD/MM/YYYY', now())

getMilliseconds

Same as moment.milliseconds()

getMilliseconds(now())

getSeconds

Same as moment.seconds()

getSeconds(now())

now

Same as moment() without arguments

now()

parse

Same as moment() with two arguments

parse('DD/MM/YYYY', '31/10/1993')

parseISO

Same as moment() with one argument

parseISO('1993-10-31')

parseUnix

Same as moment.unix()

parseUnix(752041500)

subtract

Same as moment.subtract()

subtract('days', 2, now())

Missing a function?

Fell free to send a Pull Request! ❤️

momento's People

Contributors

grvcoelho avatar mccraveiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

momento's Issues

New project name

Hi!

I'm looking for a new project name as functional-moment is already taken on NPM and I would love to hear your suggestions!

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.