{"id":26447432,"url":"https://github.com/bitfertig/datebob.js","last_synced_at":"2025-03-18T13:57:12.021Z","repository":{"id":57108568,"uuid":"260708579","full_name":"Bitfertig/datebob.js","owner":"Bitfertig","description":"datebob.js - Easy dates with javascript","archived":false,"fork":false,"pushed_at":"2020-11-18T14:53:50.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T22:07:50.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://tools.bitfertig.de/datebob.js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bitfertig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"dipser","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-02T14:48:31.000Z","updated_at":"2021-01-25T17:55:11.000Z","dependencies_parsed_at":"2022-08-21T04:30:38.060Z","dependency_job_id":null,"html_url":"https://github.com/Bitfertig/datebob.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitfertig%2Fdatebob.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitfertig%2Fdatebob.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitfertig%2Fdatebob.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bitfertig%2Fdatebob.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bitfertig","download_url":"https://codeload.github.com/Bitfertig/datebob.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236097,"owners_count":20420752,"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","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":[],"created_at":"2025-03-18T13:57:11.276Z","updated_at":"2025-03-18T13:57:12.013Z","avatar_url":"https://github.com/Bitfertig.png","language":"JavaScript","funding_links":["https://github.com/sponsors/dipser"],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/%40dipser%2Fdatebob.js.svg)](https://badge.fury.io/js/%40dipser%2Fdatebob.js)\n[![install size](https://packagephobia.com/badge?p=@dipser/datebob.js)](https://packagephobia.com/result?p=@dipser/datebob.js)\n![](https://img.badgesize.io/Bitfertig/datebob.js/master/dist/datebob.esm.js?label=JS_file)\n\n\n\n# datebob.js\nDateBobJS is a javascript which recreates the good parts of php class [Carbon](https://carbon.nesbot.com/docs/) to have a nice and easy way to handle dates and times. DateBobJS combines two awesome javascripts ([strtotime](https://locutus.io/php/datetime/strtotime/) like [datetime formats](https://www.php.net/manual/de/datetime.formats.relative.php), [date](https://locutus.io/php/datetime/date/)) into one single javascript.\n\n\n## Demo\n\nhttp://tools.bitfertig.de/datebob.js/\n\n\n## Installation\n\n```bash\nnpm i @dipser/datebob.js\n```\n\n\n## Usage\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { datebob, DateBob } from \"@dipser/datebob.js\";\nconsole.log( new DateBob('now') );\nconsole.log( datebob('now') );\n\u003c/script\u003e\n```\n\n\n## Features\n\n### Instance\n\n```js\nnew DateBob()\ndatebob() // now\ndatebob(Date date)\ndatebob(DateBob datebob)\ndatebob(String strtotime)\n```\n\n### Methods\n\n| Method  \t| Description  \t|\n|---\t|---\t|\n| .modify(String *strtotime*)  \t| See php.net/strtotime  \t|\n| .format(String *format*)  \t| See php.net/date  \t|\n\n\n## Examples\n\n```javascript\ndatebob()\n// =\u003e returns a Date()-Object.\n\ndatebob('yesterday 12:34:56')\n// =\u003e returns a Date()-Object of yesterday.\n\ndatebob(datebob('2020-01-01')).format('D, Y-m-d H:i:s')\n// =\u003e Mon, 2020-08-24 21:17:17\n\ndatebob('2020-01-01').modify('+ 1 day').format('D, Y-m-d H:i:s')\n// =\u003e Thu, 2020-01-02 00:00:00\n```\n\n## Contributing to this npm package\n\n\n```bash\n# go to directory\ncd .../project\n\n# install npm dependencies\nnpm install\n\n# run webpack watcher and then open development url\nnpm run dev\n\n# create a build\nnpm run build\n```\n\n## Publishing npm package\n\nPublish to: @dipser/datebob.js\n\n```bash\nnpm publish\n```\n\n\n-----\n## Ideas\n\n##### 1. New date formatting with Intl.DateTimeFormat language support\nUse this for formatting, and get language support:\nhttps://jsbin.com/velaqabivo/1/edit?js,console\ncarbon().locale('de').format('F') // =\u003e Januar\n\n##### 2. New relative formatting with Intl.RelativeTimeFormat\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat\ncarbon().locale('en').relformat() // \"in 3 days\" or \"3 days ago\"\n\n\n## Statistics\n\n[Anvaka Graph](https://npm.anvaka.com/#!/view/3d/@dipser/datebob.js#/view/2d/%40dipser%2Fdatebob.js)\n\n\n## Alternatives\n\n[dayjs](https://github.com/iamkun/dayjs/),\n[momentjs](https://github.com/moment/moment/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfertig%2Fdatebob.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfertig%2Fdatebob.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfertig%2Fdatebob.js/lists"}