{"id":18573845,"url":"https://github.com/numax-cz/napicudateformatter","last_synced_at":"2025-05-15T23:34:11.314Z","repository":{"id":53850536,"uuid":"480835403","full_name":"Numax-cz/NapicuDateFormatter","owner":"Numax-cz","description":"Package for formatting Date \u0026 Time","archived":false,"fork":false,"pushed_at":"2023-01-22T15:48:43.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T02:22:11.894Z","etag":null,"topics":["date","date-format","date-formatter","date-formatting","formatter","napicuweb","time","typescript"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/napicuformatter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Numax-cz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-12T14:02:15.000Z","updated_at":"2022-10-15T16:48:59.000Z","dependencies_parsed_at":"2023-02-12T16:45:45.842Z","dependency_job_id":null,"html_url":"https://github.com/Numax-cz/NapicuDateFormatter","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/Numax-cz%2FNapicuDateFormatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Numax-cz%2FNapicuDateFormatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Numax-cz%2FNapicuDateFormatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Numax-cz%2FNapicuDateFormatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Numax-cz","download_url":"https://codeload.github.com/Numax-cz/NapicuDateFormatter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442321,"owners_count":22071863,"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":["date","date-format","date-formatter","date-formatting","formatter","napicuweb","time","typescript"],"created_at":"2024-11-06T23:13:09.161Z","updated_at":"2025-05-15T23:34:11.293Z","avatar_url":"https://github.com/Numax-cz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NapicuDateFormatter\n\n- NapicuDateFormatter is a simple date \u0026 time formatter for easy processing of date and time\n\n# Variables for formating\n\n\u003ctable\u003e\n   \u003cthead\u003e\n      \u003ctr\u003e\n         \u003cth\u003eName\u003c/th\u003e\n         \u003cth\u003eCode\u003c/th\u003e\n         \u003cth\u003eDescription\u003c/th\u003e\n      \u003c/tr\u003e\n   \u003c/thead\u003e\n   \u003ctbody\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eYear\u003c/td\u003e\n         \u003ctd\u003e%yyyy\u003c/td\u003e\n         \u003ctd\u003eReturns the current year in number\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMonth\u003c/td\u003e\n         \u003ctd\u003e%MM\u003c/td\u003e\n         \u003ctd\u003eReturns the current month in number\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMonth name\u003c/td\u003e\n         \u003ctd\u003e%MMN\u003c/td\u003e\n         \u003ctd\u003eReturns the current month name - short\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMonth name - short\u003c/td\u003e\n         \u003ctd\u003e%MN\u003c/td\u003e\n         \u003ctd\u003eReturns the current month name\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eDay\u003c/td\u003e\n         \u003ctd\u003e%dd\u003c/td\u003e\n         \u003ctd\u003eReturns the day of the week, using local time\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMaxDays\u003c/td\u003e\n         \u003ctd\u003e%DMAX\u003c/td\u003e\n         \u003ctd\u003eReturns the maximum number of days in current month\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eDate\u003c/td\u003e\n         \u003ctd\u003e%dt\u003c/td\u003e\n         \u003ctd\u003eReturns the day-of-the-month, using local time\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eDay name\u003c/td\u003e\n         \u003ctd\u003e%ddn\u003c/td\u003e\n         \u003ctd\u003eReturns the current day name\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eDay name - short\u003c/td\u003e\n         \u003ctd\u003e%dn\u003c/td\u003e\n         \u003ctd\u003eReturns the current day name - short\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003e24H\u003c/td\u003e\n         \u003ctd\u003e%HH\u003c/td\u003e\n         \u003ctd\u003eReturns the current hour in 24H format\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003e12H\u003c/td\u003e\n         \u003ctd\u003e%hh\u003c/td\u003e\n         \u003ctd\u003eReturns the current hour in 12H format\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMinutes\u003c/td\u003e\n         \u003ctd\u003e%mm\u003c/td\u003e\n         \u003ctd\u003eReturns the current minutes in number\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eSeconds\u003c/td\u003e\n         \u003ctd\u003e%ss\u003c/td\u003e\n         \u003ctd\u003eReturns the current seconds\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eMeridian\u003c/td\u003e\n         \u003ctd\u003e%a\u003c/td\u003e\n         \u003ctd\u003eReturns the current meridian\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n         \u003ctd\u003eTime zone\u003c/td\u003e\n         \u003ctd\u003e%z\u003c/td\u003e\n         \u003ctd\u003eReturns the time zone\u003c/td\u003e\n      \u003c/tr\u003e\n\n   \u003c/tbody\u003e\n\u003c/table\u003e\n\n# Example\n\n### Importing\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n```\n\n```javascript\nconst NapicuDate = require('napicuformatter');\n```\n\n### Formatting\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nlet i = new NapicuDate().format('%yyyy-%MM-%dt %HH:%mm:%ss');\nconsole.log(i); // 2022-4-12 16:59:30\n```\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nlet i = new NapicuDate().format('Time: %HH:%mm:%ss');\nconsole.log(i); // Time: 16:59:30\n```\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nlet i = new NapicuDate().format('Date: %MMN');\nconsole.log(i); // Date: April\n```\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nlet i = new NapicuDate().format('Day: %ddn');\nconsole.log(i); // Day: Thursday\n```\n\n### Custom Date\n```typescript\nimport { NapicuDate } from 'napicuformatter';\nlet i = new NapicuDate(2023, 9, 9, 23, 23, 23, 1000).format('%yyyy-%MM-%dt %HH:%mm:%ss');\nconsole.log(i); //2023-9-9 23:23:24\n```\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\nlet i = new NapicuDate(1547778643657).format('%yyyy-%MM-%dt %HH:%mm:%ss');\nconsole.log(i); //2019-1-18 3:30:43\n```\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\nlet i = new NapicuDate(2016, 6, 6).format('%yyyy-%MM-%dt %HH:%mm:%ss');\nconsole.log(i); //2019-1-18 3:30:43\n```\n\n\n### Getting\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nlet i = new NapicuDate();\n\ni.getLanguageDays(); // Returns the days of the week in the config language\ni.getLanguageShortsDays(); // Returns shortened days of the week in the config language\ni.getLanguageMonths(); // Returns  he months of the year in the config language\ni.getLanguageShortsMonths(); // Returns shortened months of the year in the config language\ni.getCurrentDay(); // Returns the day of the week, using local time\ni.getCurrentDate(); // Returns the day-of-the-month, using local time\ni.getMaxDaysInCurrentMonth(); //Returns the maximum number of days in current month\ni.getCurrentMonth(); // Returns the current month\ni.getCurrentYear(); // Returns the current year\ni.getCurrentSeconds(); // Returns the current seconds\ni.getCurrentMinutes(); // Returns the current minutes\ni.getCurrentHours(); // Returns the current hours\ni.getCurrentDayName(); // Returns the current day name in the config language\ni.getCurrentMonthName(); // Returns the current month name in the config language\ni.getCurrentMeridian(); // Returns the current meridian (AM/PM)\ni.getTimeStamp(); //Returns the time value in milliseconds\n```\n\n### Static methods\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nNapicuDate.getLanguageDays(); // Returns the days of the week in the config language\nNapicuDate.getLanguageMonths(); // Returns  he months of the year in the config language\nNapicuDate.getLanguageShortsDays(); // Returns shortened days of the week in the config language\nNapicuDate.getLanguageShortsMonths(); // Returns shortened months of the year in the config language\n```\n\n### Use with config\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nNapicuDate.use({\n  shortNameLength: 2,\n});\n\nlet i = NapicuDate.getLanguageShortsDays();\nconsole.log(i);\n//[\n//  'Mo', 'Tu',\n//  'We', 'Th',\n//  'Fr', 'Sa',\n//  'Su'\n//]\n```\n\n### Configuration\n\n```typescript\nimport { NapicuDate } from 'napicuformatter';\n\nNapicuDate.use({\n  days: [\n    'Monday', // 1\n    'Tuesday', // 2\n    'Wednesday', // 3\n    'Thursday', // 4\n    'Friday', // 5\n    'Saturday', // 6\n    'Sunday', // 7\n  ],\n\n  months: [\n    'January', // 1\n    'February', // 2\n    'March', // 3\n    'April', // 4\n    'May', // 5\n    'June', // 6\n    'July', // 7\n    'August', // 8\n    'September', // 9\n    'October', // 10\n    'November', // 11\n    'December', // 12\n  ],\n  shortNameLength: 3, // Short name length - default 3\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumax-cz%2Fnapicudateformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumax-cz%2Fnapicudateformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumax-cz%2Fnapicudateformatter/lists"}