All Projects → icambron → Twix.js

icambron / Twix.js

Licence: mit
⌛️↔️ A date range plugin for moment.js

Programming Languages

coffeescript
4710 projects

Projects that are alternatives of or similar to Twix.js

react-native-daterange-picker
A React Native component for picking date ranges or single dates.
Stars: ✭ 86 (-77.01%)
Mutual labels:  moment, daterange
Vuetify Daterange Picker
The missing date range picker for Vuetify JS you have been looking for.
Stars: ✭ 192 (-48.66%)
Mutual labels:  moment, daterange
Angular Bootstrap Datetimepicker
Native Angular date/time picker component styled by Twitter Bootstrap
Stars: ✭ 1,289 (+244.65%)
Mutual labels:  moment, daterange
rn-date-range
date picker component for react native
Stars: ✭ 16 (-95.72%)
Mutual labels:  daterange
moment-recur-ts
Conversion of the moment-recur library into TypeScript.
Stars: ✭ 17 (-95.45%)
Mutual labels:  moment
moment-dayjs-codemod
A Codemod to migrate from moment.js to day.js
Stars: ✭ 20 (-94.65%)
Mutual labels:  moment
dayjs
Extended fork of Day.js - 2KB immutable date library alternative to Moment.js
Stars: ✭ 36 (-90.37%)
Mutual labels:  moment
moment-cache
⏱ Simple utility to cache moment.js results and speed up moment calls.
Stars: ✭ 29 (-92.25%)
Mutual labels:  moment
vue-daterangepicker-component
Date range picker for Vue 1.x, based on bootstrap-daterangepicker
Stars: ✭ 22 (-94.12%)
Mutual labels:  daterange
node-red-contrib-moment
Node-Red Node that produces formatted Date/Time output using the Moment.JS library. Timezone, dst and locale aware.
Stars: ✭ 31 (-91.71%)
Mutual labels:  moment
ng2-timezone-selector
A simple Angular module to create a timezone selector using moment-timezone.
Stars: ✭ 12 (-96.79%)
Mutual labels:  moment
chronos
One library to rule the time
Stars: ✭ 17 (-95.45%)
Mutual labels:  moment
relative.time.parser
Moment.js Plugin for parsing Relative Time Strings
Stars: ✭ 13 (-96.52%)
Mutual labels:  moment
react-daterange-picker
A react date range picker to using @material-ui. Live Demo: https://flippingbitss.github.io/react-daterange-picker/
Stars: ✭ 85 (-77.27%)
Mutual labels:  daterange
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-93.32%)
Mutual labels:  moment
moment-holiday
A Moment.js plugin for handling holidays. NO LONGER MAINTAINED (DEPRECATED)
Stars: ✭ 82 (-78.07%)
Mutual labels:  moment
aestheticDialogs
📱 Flutter Plugin for 💫fluid, 😍beautiful, 🎨custom Dialogs
Stars: ✭ 19 (-94.92%)
Mutual labels:  moment
imrc-datetime-picker
(Improved) React component datetime picker by momentjs 📆
Stars: ✭ 21 (-94.39%)
Mutual labels:  moment
Vue Functional Calendar
Vue.js Functional Calendar | Component/Package
Stars: ✭ 314 (-16.04%)
Mutual labels:  daterange
React Native Timeago
An auto-updating timeago component for React Native using moment.js
Stars: ✭ 339 (-9.36%)
Mutual labels:  moment

Twix.js

MIT License Build Status Version NPM version

Twix is a comprehensive JS library for working with date ranges, and includes a customizable smart formatter. It's written in CoffeeScript and it depends on Moment.js.

Some examples:

var t = moment("1982-01-25T09:30").twix("1982-01-25T13:30");

t.format();  //=> Jan 25, 1982, 9:30 AM - 1:30 PM

t.isSame("day"); //=> true
t.humanizeLength(); //=> "4 hours"
t.count("days"); //=> 1
t.intersection(otherRange); //=> another range

See the documentation for more.

Documentation

You can find comprehensive docs here:

Detailed documentation

Breaking change in 1.0.0: Removed the deprecated showYear and showDate smart formatter options. Use hideYear, hideDate, implicitYear, and implicitDate instead.

Building

If you want to build and test Twix for yourself, make wraps everything you need:

Command Function
make configure Install dependencies (same as npm install)
make or make build Compile src/*.coffee to dist/*.js
make test Run Mocha suite
make lint Linter
make bench Microbenchmarks

Contributing

Patches are welcome!

  • Don't include your changes to the generated .js files in the patch; they're much harder to merge. I'll generate them when I cut the release.
  • Make sure you run the linter and the tests before submitting a PR. Use make lint and make test.
  • If you make a change that will need documentation, make the appropriate update to docs. It will get published to the website on the next release.

Changelog

CHANGELOG

Copyright and License

Copyright 2012-2015 Isaac Cambron and contributors. Distributed under the MIT License. See LICENSE for details.

Phasers to stun

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].