GithubHelp home page GithubHelp logo

date-fns / date-fns.org Goto Github PK

View Code? Open in Web Editor NEW
53.0 8.0 31.0 2.11 MB

🏑 date-fns website 🌈

Home Page: https://date-fns.org

License: MIT License

JavaScript 0.17% CSS 1.41% TypeScript 98.34% Shell 0.08%
date-fns hacktoberfest

date-fns.org's Introduction

πŸŽ‰οΈ NEW: date-fns v3 is out!

date-fns

date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js

πŸ‘‰ Documentation

πŸ‘‰ Blog


It's like Lodash for dates

  • It has 200+ functions for all occasions.
  • Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
  • Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
  • Immutable & Pure: Built using pure functions and always returns a new date instance.
  • TypeScript: The library is 100% TypeScript with brand-new handcrafted types.
  • I18n: Dozens of locales. Include only what you need.
  • and many more benefits
import { compareAsc, format } from "date-fns";

format(new Date(2014, 1, 11), "yyyy-MM-dd");
//=> '2014-02-11'

const dates = [
  new Date(1995, 6, 2),
  new Date(1987, 1, 11),
  new Date(1989, 6, 10),
];
dates.sort(compareAsc);
//=> [
//   Wed Feb 11 1987 00:00:00,
//   Mon Jul 10 1989 00:00:00,
//   Sun Jul 02 1995 00:00:00
// ]

The library is available as an npm package. To install the package run:

npm install date-fns --save

Docs

See date-fns.org for more details, API, and other docs.


License

MIT Β© Sasha Koss

date-fns.org's People

Contributors

bl-ue avatar ckcherry23 avatar fturmel avatar j-f1 avatar kossnocorp avatar leshakoss avatar tan75 avatar timrael 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

date-fns.org's Issues

Add `dateFns` object to global scope on date-fns.org

Sometimes it's super useful to try some functions right on the date-fns.org website. The easiest way to do this - make available dateFns object in global scope. Every developer could just open a console of the browser, try and combine any functions.

For example, https://lodash.com/ has global _ object on their website and I often use it.

No arguments functions bug

If function has no arguments, site fails to show its documentation. E.g.: endOfToday, endOfTomorrow, endOfYesterday
Error:
TypeError: undefined is not an object (evaluating 'args.map')

Improve SEO

  • Set basic meta tags
  • Set Facebook tags
  • Set Twitter tags

Example rendering bug

  1. open any documentation entry with @example
  2. open any other documentation entry with @example
  3. @example of the first entry is shown instead of @example of the second
  4. open documentation entry without @example to reset shown example

Usage section

Two tabs:

  1. CommonJS: var nameOfFunction = require('date-fns/name_of_function')
  2. UMD: var nameOfFunction = dateFns.nameOfFunction

Scroll behavior is weird when navigating

When navigating to a different doc page after having scrolled the current page (which is a common use case when reading the doc), the right panel keeps its scroll position after updating its content. This is very confusing because it forces to scroll up to be able to start reading the new content.
I suggest scrolling to top again when switching page.

I'm using Firefox in case this is browser-specific.

Update "Getting Started" section

  • Add an example with <script> to the Bower tab
  • Add an example to the CDN (cdn.date-fns.org/v1.0.0-rc10/date_fns.js)
  • Add a link to download to the CDN tab

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.