{"id":22486104,"url":"https://github.com/prantlf/dayjs","last_synced_at":"2025-08-02T19:30:45.792Z","repository":{"id":32989194,"uuid":"144820170","full_name":"prantlf/dayjs","owner":"prantlf","description":"Extended fork of Day.js - 2KB immutable date library alternative to Moment.js","archived":false,"fork":true,"pushed_at":"2022-01-03T19:22:59.000Z","size":4402,"stargazers_count":35,"open_issues_count":12,"forks_count":5,"subscribers_count":2,"default_branch":"combined","last_synced_at":"2025-07-04T09:49:36.991Z","etag":null,"topics":["date","date-formatting","datetime","dayjs","moment","time","timezones"],"latest_commit_sha":null,"homepage":"https://github.com/prantlf/dayjs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"iamkun/dayjs","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prantlf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-15T07:26:22.000Z","updated_at":"2024-05-23T15:55:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prantlf/dayjs","commit_stats":null,"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/prantlf/dayjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fdayjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fdayjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fdayjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fdayjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/dayjs/tar.gz/refs/heads/combined","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Fdayjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268440162,"owners_count":24250737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","date-formatting","datetime","dayjs","moment","time","timezones"],"created_at":"2024-12-06T17:13:54.354Z","updated_at":"2025-08-02T19:30:45.485Z","avatar_url":"https://github.com/prantlf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eDay.js Extended\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eFast \u003cb\u003e2kB\u003c/b\u003e alternative to Moment.js with the same modern API\u003c/p\u003e\n\u003cp align=\"center\"\u003e(This is an \u003ca href=\"#extensions-to-the-original-project\"\u003eextended\u003c/a\u003e fork of the \u003ca href=\"https://github.com/iamkun/dayjs\"\u003eoriginal project\u003c/a\u003e.)\u003c/p\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://unpkg.com/dayjs-ext/dayjs.min.js\"\u003e\u003cimg\n       src=\"http://img.badgesize.io/https://unpkg.com/dayjs-ext/dayjs.min.js?compression=gzip\u0026style=flat-square\"\n       alt=\"Gzip Size\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/dayjs-ext\"\u003e\u003cimg\n       src=\"https://img.shields.io/npm/v/dayjs-ext.svg?style=flat-square\u0026colorB=51C838\"\n       alt=\"NPM Version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/prantlf/dayjs\"\u003e\u003cimg\n       src=\"https://img.shields.io/travis/prantlf/dayjs/master.svg?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/prantlf/dayjs\"\u003e\u003cimg\n       src=\"https://img.shields.io/codecov/c/github/prantlf/dayjs/master.svg?style=flat-square\" alt=\"Codecov\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/prantlf/dayjs\"\u003e\u003cimg\n       src=\"https://david-dm.org/prantlf/dayjs.svg\" alt=\"Dependency Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/prantlf/dayjs#info=devDependencies\"\u003e\u003cimg\n       src=\"https://david-dm.org/prantlf/dayjs/dev-status.svg\" alt=\"Dependency Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/prantlf/dayjs/blob/master/LICENSE\"\u003e\u003cimg\n       src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.\n\n```js\ndayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');\n```\n\n* 🕒 Familiar Moment.js API \u0026 patterns\n* 💪 Immutable\n* 🔥 Chainable\n* 🌐 I18n support\n* 📦 2kb mini library\n* 👫 All browsers supported\n\n## Extensions to the original project\n\n* New plugin \"[customParseFormat]\" to parse input strings using custom formats.\n* New plugin \"[localizableFormat]\" to format dates according to the chosen locale.\n* New plugin \"[timeZone]\" to parse from and format to a date string using a time zone specified by its canonical name.\n* Corrected plugin \"[relativeTime]\" honouring grammar rules of the supported languages.\n* \"[UTC mode]\" for working in UTC, or for working with date-only values without the time part.\n* Additional locales ([cs], [ru], [sk], [uk]).\n* Check for `dayjs` instance by the `instanceof` operator.\n\n## Synopsis\n\n`Day.js` is usually imported via a \"proxy module\", which loads required plugins and registers required language packs. For example, via the following `dayjs-local.js`:\n\n```js\n// Load dayjs, plugins and language packs.\nimport dayjs from 'dayjs-ext'\n// import \"timeZone-1900-2050\", \"timeZone-1970-2038\"\n// or \"timeZone-2012-2022\" to save your package size\nimport timeZonePlugin from 'dayjs-ext/plugin/timeZone'\nimport customParseFormat from 'dayjs-ext/plugin/customParseFormat'\nimport localizableFormat from 'dayjs-ext/plugin/localizableFormat'\nimport relativeTime from 'dayjs-ext/plugin/relativeTime'\nimport 'dayjs-ext/locale/cs'\nimport 'dayjs-ext/locale/sk'\n\n// Register plugins and language packs; Czech will be the default language.\ndayjs.extend(timeZonePlugin)\n     .extend(customParseFormat)\n     .extend(localizableFormat)\n     .extend(relativeTime)\n     .locale('cs')\n\nexport default dayjs\n```\n\nTypical usage scenarios:\n\n\n```js\nimport dayjs from './dayjs-local'\n\n// Load a date+time from a storage and show it to the user.\nconst dateTime = dayjs('2018-10-28T18:45:00.000Z')\nconsole.log(dateTime.format({ format: 'L LT', timeZone: 'Europe/Prague' }))\n// Prints \"28.10.2018 19:45\".\nconsole.log(dateTime.fromNow())\n// Prints \"před 5 hodinami\" (5 hours ago).\n\n// Read a date+time from the user and format it for the storage.\nconst dateTime = dayjs('28.10.2018 19:45', { format: 'L LT', timeZone: 'Europe/Prague' })\nconsole.log(dateTime.toISOString())\n// Prints \"2018-10-28T18:45:00.000Z\".\n\n// Set only the date; zero the time and prevent local time zone conversion.\nconst dateOnly = dayjs('2018-10-28', { utc: true })\nconsole.log(dateOnly.format({ format: 'YYYY-MM-DD' }))\n// Prints \"2018-10-28\" anytime and anywhere.\n```\n\nIf used in the browser, the following scripts would be needed:\n\n```html\n\u003c-- include \"index-1900-2050\", \"index-1970-2038\"\n    or \"index-2012-2022\" to save your package size --\u003e\n\u003cscript arc=\"https://unpkg.com/timezone-support/dist/index.umd.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/fast-plural-rules/dist/index.umd.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/dayjs-ext/dayjs.min.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/dayjs-ext/plugin/timeZone.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/dayjs-ext/plugin/customParseFormat.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/dayjs-ext/plugin/localizableFormat.js\"\u003e\u003c/script\u003e\n\u003cscript arc=\"https://unpkg.com/dayjs-ext/plugin/relativeTime.js\"\u003e\u003c/script\u003e\n```\n\n## Getting Started\n\n### Installation\n\n```console\nnpm install dayjs-ext --save\n```\n\n📚[Installation Guide](./docs/en/Installation.md)\n\n### API\n\nIt's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.\n\n```javascript\ndayjs('2018-08-08') // parse\n\ndayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display\n\ndayjs().set('month', 3).month() // get \u0026 set\n\ndayjs().add(1, 'year') // manipulate\n\ndayjs().isBefore(dayjs()) // query\n```\n\n📚[API Reference](./docs/en/API-reference.md)\n\n### I18n\n\nDay.js has great support for internationalization.\n\nBut none of them will be included in your build unless you use it.\n\n```javascript\nimport 'dayjs-ext/locale/es' // load on demand\n\ndayjs.locale('es') // use Spanish locale globally\n\ndayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance\n```\n📚[Internationalization](./docs/en/I18n.md)\n\n### Plugin\n\nA plugin is an independent module that can be added to Day.js to extend functionality or add new features.\n\n```javascript\nimport timeZone from 'dayjs-ext/plugin/timeZone' // load on demand\n\ndayjs.extend(timeZone) // use plugin\n\ndayjs().format('D.M.YYYY H:mm',\n  { timeZone: 'Europe/Berlin' }) // convert to CET before formatting\n```\n\n📚[Plugin List](./docs/en/Plugin.md)\n\n## Sponsors\n\nSee the [sponsor list at the original project]. Thank you for your support!\n\n## Contributors\n\nSee the [contributor list at the original project]. Thank you for your help!\n\n## License\n\nDay.js is Extended licensed under a [MIT  License](./LICENSE).\n\n[original project]: https://github.com/iamkun/dayjs\n[sponsor list at the original project]: https://github.com/iamkun/dayjs#sponsors\n[contributor list at the original project]: https://github.com/iamkun/dayjs#sponsors\n[customParseFormat]: ./docs/en/Plugin.md#customParseFormat\n[localizableFormat]: ./docs/en/Plugin.md#localizableformat\n[timeZone]: ./docs/en/Plugin.md#timezone\n[relativeTime]: ./docs/en/Plugin.md#relativetime\n[UTC mode]: ./docs/en/API-reference.md#utc-mode\n[cs]: ./src/locale/cs.js\n[ru]: ./src/locale/ru.js\n[sk]: ./src/locale/sk.js\n[uk]: ./src/locale/uk.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fdayjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Fdayjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Fdayjs/lists"}