{"id":15019381,"url":"https://github.com/amir-rh99/ngx-date-picker","last_synced_at":"2025-06-11T05:32:48.150Z","repository":{"id":65563580,"uuid":"534253351","full_name":"amir-rh99/ngx-date-picker","owner":"amir-rh99","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-18T16:57:14.000Z","size":801,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-02T08:45:26.687Z","etag":null,"topics":["angular","datepicker","jalali-datepicker"],"latest_commit_sha":null,"homepage":"","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/amir-rh99.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":"2022-09-08T14:34:48.000Z","updated_at":"2024-05-15T10:40:36.000Z","dependencies_parsed_at":"2023-01-29T20:00:41.688Z","dependency_job_id":null,"html_url":"https://github.com/amir-rh99/ngx-date-picker","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/amir-rh99%2Fngx-date-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amir-rh99%2Fngx-date-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amir-rh99%2Fngx-date-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amir-rh99%2Fngx-date-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amir-rh99","download_url":"https://codeload.github.com/amir-rh99/ngx-date-picker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amir-rh99%2Fngx-date-picker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259207602,"owners_count":22821717,"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":["angular","datepicker","jalali-datepicker"],"created_at":"2024-09-24T19:53:24.547Z","updated_at":"2025-06-11T05:32:48.089Z","avatar_url":"https://github.com/amir-rh99.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular Date Picker\n![Angular Date Picker](https://github.com/amir-rh99/ngx-date-picker/raw/master/src/assets/AngularDatePicker.png)\n\nngx-date-picker is a customizable jalali ( persian ) and gregorian date picker for Angular +12\n\n[Check online demo](https://amir-rh99.github.io/ngx-date-picker/)\n\n## Install and Setup\n### step 1: install @ah99/ngx-date-picker\n\n```bash\nnpm i @ah99/ngx-date-picker\n```\n### step 2: Import NgxDatePickerModule to your module\n\n```typescript\nimport { NgxDatePickerModule } from '@ah99/ngx-date-picker'\n\n@NgModule({\n    imports: [\n        NgxDatePickerModule.forRoot() // dont forget forRoot()\n    ]\n})\n```\n### step 3: Import css styles to your global styles ( usually styles/.css/.scss/.less/ )\n```css\n  @import \"@ah99/ngx-date-picker/styles\"\n```\n## Use\nuse `ngx-date-picker` directive on any `html input element` you need\n```html\n  \u003cinput ngx-date-picker [(ngModel)]=\"dateControl\"\u003e\n```\n**important**: you need to setup one form model in your input element with formControl or ngModel So you must have already imported **FormsModule** or **ReactiveFormsModule** in your module.\n\n## Config\nThere are some options for config your date picker as below:\n\n| Option | Type | Default | Description\n| ------ | ---- | ------- | ----------\n| calendar | \"gregorian\" \\| \"jalali\" | \"gregorian\" | Type of your calendar\n| format | [ValueFormat](#ValueFormat) | \"DD/MM/YYYY\" | Format of your input element value\n| outputData | object | [OutputEvent Config](#OutputEventConfig) | Output values from the [onDateSelect]() event\n| displayFooter | boolean | true | This option is for date picker action buttons. date picker will be closed immediately after selecting the date if this option set to false.\n| doneText | string | \"Done\" | Done action text\n| cancelText | string | \"Cancel\" | Done action text\n| theme | \"light\" \\| \"dark\" | \"light | Date picker theme mode\n| themeConfig | object | [Default Theme Config](#DefaultThemeConfig) | You can change default styles like Primary-Color in light and dark mode\n\n#### ValueFormat\n```javascript\n\"MM/DD/YYYY\" | \"MM-DD-YYYY\" | \"DD-MM-YYYY\" | \"DD/MM/YYYY\"\n```\n\n#### OutputEventConfig\n```javascript\noutputData: {\n  date: true, // boolean\n  type: false, // boolean\n  year: false, // boolean\n  month: false, // boolean\n  day: false // boolean\n}\n```\n#### DefaultThemeConfig\n```javascript\nthemeConfig: {\n    light: {\n        primaryColor: \"#777777\", // string\n        secondaryColor: \"#444444\", // string\n        backgroudColor: \"#ffffff\" // string\n    },\n    dark: {\n        primaryColor: \"#ffffff\", //string\n        secondaryColor: \"#eeeeee\", // string\n        backgroudColor: \"#444444\" // string\n    },\n    rounded: \"medium\" // flase | \"medium\" | \"full\"\n}\n```\n## How to config?\nIf you want customize default configs, you can do it in two ways:\n\n### 1. Global Config\nDefine your configs inside the NgxDatePickerModule.forRoot() . This configs will be applied to all date pickers.\n\n#### Example:\n```typescript\nNgxDatePickerModule.forRoot({\n  calendar: \"jalali\",\n  displayFooter: false,\n  theme: \"dark\",\n  themeConfig: {\n    rounded: \"full\",\n    dark: {\n      primaryColor: \"#bbbbbb\"\n    }\n  }\n})\n```\n\u003e All of your configs will be merged with default configs\n\n### 2. Individual  Config\nYou can set individual configs for every date picker by pass your custom configs to it with **datePickerConfig**.\n#### Example:\n```html\n\u003c!-- HTML template --\u003e\n\n\u003cinput ngx-date-picker [(ngModel)]=\"dateControl\"\n[datePickerConfig]=\"customConfig\"\u003e\n```\n```typescript\n// typescript component\n\nimport { CustomConfig } from '@ah99/ngx-date-picker';\n...\ncustomConfig: CustomConfig = {\n  calendar: \"gregorian\",\n  format: \"DD-MM-YYYY\",\n  themeConfig: {\n    light: {\n      primaryColor: \"#ca8c07\"\n    }\n  }\n}\n```\n\u003e Your individual configs will be merged with global configs\n\n## Output Event (onDateSelect)\nThis event will be triggered when you select the date. The output value will be an object whose fields you can specify in [OutputEvent Config](#OutputEventConfig).\n#### Example:\n```html\n\u003cinput ngx-date-picker [(ngModel)]=\"dateControl\"\n(onDateSelect)=\"log($event)\"\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famir-rh99%2Fngx-date-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famir-rh99%2Fngx-date-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famir-rh99%2Fngx-date-picker/lists"}