{"id":19361798,"url":"https://github.com/missthee/datetool","last_synced_at":"2025-11-16T21:04:32.136Z","repository":{"id":46996713,"uuid":"311619397","full_name":"MissThee/datetool","owner":"MissThee","description":"JavaScript Date tool for formatting and processing","archived":false,"fork":false,"pushed_at":"2022-12-27T07:20:16.000Z","size":1213,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T17:02:47.935Z","etag":null,"topics":["dateformat","javascript","js"],"latest_commit_sha":null,"homepage":"","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/MissThee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-10T10:13:05.000Z","updated_at":"2022-12-27T07:20:12.000Z","dependencies_parsed_at":"2023-01-31T02:46:05.100Z","dependency_job_id":null,"html_url":"https://github.com/MissThee/datetool","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/MissThee%2Fdatetool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MissThee%2Fdatetool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MissThee%2Fdatetool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MissThee%2Fdatetool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MissThee","download_url":"https://codeload.github.com/MissThee/datetool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240480278,"owners_count":19808227,"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":["dateformat","javascript","js"],"created_at":"2024-11-10T07:25:27.311Z","updated_at":"2025-11-16T21:04:32.054Z","avatar_url":"https://github.com/MissThee.png","language":"JavaScript","readme":"![datetool](https://socialify.git.ci/MissThee/datetool/image?description=1\u0026forks=1\u0026language=1\u0026owner=1\u0026pattern=Circuit%20Board\u0026stargazers=1\u0026theme=Light)\n# date-tool\n\n## Overview\nAn open source simple JavaScript Date library for formatting and processing.\n\n## Getting Started\ninstall\n```\nnpm i @missthee/datetool\n```\nuse\n```js\nimport { dateToString, addDay, DateHepler } from \"@missthee/datetool\";\nlet date = new Date('2000/01/01');\n//formatting\nconsole.log(dateToString(date, 'yyyy-MM-dd')); // 2000-01-01\n//processing\n//NOTICE: All calculation operations will change the incoming Date object\nlet result = addDay(date, 1); \nconsole.log(result); // 2000-01-02\nconsole.log(date);   // 2000-01-02\n```\n\n## Example\n```js\nimport {DateHelper, dateToStringFactory, dateToString, getFullDayInMonth, isLeapYear, addMillisecond, addSecond, addMinute, addHour, addDay, addMonth, addYear,} from \"@missthee/datetool\";\nlet date = new Date('2000-01-01');\n\n//formatting\ndateToString(date, 'yyyyMMdd');     //20000101\nlet dts = dateToStringFactory('yyyyMMdd');\ndts(date);                          //20000101\ndts(new Date('2020/11/11'));        //20201111\n\n//processing\n//NOTICE: All calculation operations will change the incoming Date object\nnew DateHelper(date).addDay(1).addMonth(1).addYear(-1).getDate();\naddYear(date, 1);\naddMonth(date, 1);\naddDay(date, 1);\naddHour(date, 1);\naddMinute(date, 1);\naddSecond(date, 1);\naddMillisecond(date, 1);\n\n//misc\nisLeapYear(2000); //true\ngetFullDayInMonth(2000, 1); //29\n\n```\n\n## Converting to String\n| Key   | Description                                       | Value         |\n| :---- | :----                                             | :----         |\n| yyyy  | The year                                          | `1999` `2001` | \n| yy    | The year's last two-digit number                  | `99` `01`     |\n| MM    | The month of the year with leading zero           | `01` - `12`   |\n| M     | The month of the year between 1-12                | `1` - `12`    |\n| dd    | The day of the month with leading zero            | `01` - `31`   |\n| d     | The day of the month between 1 and 31             | `1`  - `31`   |\n| HH    | The hour of the day with leading zero             | `00` - `23`   |\n| H     | The hour of the day between 0-23                  | `0` - `23`    |\n| hh    | The hour of the day with leading zero             | `01` - `12`   |\n| h     | The hour of the day between 1-12                  | `1` - `12`    |\n| mm    | The minute of the hour with leading zero          | `00` - `59`   |\n| m     | The minute of the hour between 0-59               | `0` - `59`    |\n| ss    | The seconds of the minute with leading zero       | `00` - `59`   |\n| s     | The seconds of the minute between 0-59            | `0` - `59`    |\n| SSS   | The milliseconds of the second between .000-.999  | `000` - `999` |\n| SS    | The milliseconds of the second between .00-.99    | `00` - `99`   |\n| S     | The milliseconds of the second between .0-.9      | `0` - `9`     |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissthee%2Fdatetool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmissthee%2Fdatetool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmissthee%2Fdatetool/lists"}