{"id":13491272,"url":"https://github.com/720kb/angular-datepicker","last_synced_at":"2025-10-01T23:30:40.127Z","repository":{"id":20710725,"uuid":"23994659","full_name":"720kb/angular-datepicker","owner":"720kb","description":"Angularjs datepicker module, generate a datepicker on your input element -  https://720kb.github.io/angular-datepicker","archived":true,"fork":false,"pushed_at":"2020-11-09T13:38:26.000Z","size":804,"stargazers_count":471,"open_issues_count":82,"forks_count":329,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-01-14T01:36:19.919Z","etag":null,"topics":["angular","angular-directives","angularjs","datepicker","directive"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"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/720kb.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":"2014-09-13T13:14:28.000Z","updated_at":"2024-12-11T13:18:55.000Z","dependencies_parsed_at":"2022-09-14T03:31:03.365Z","dependency_job_id":null,"html_url":"https://github.com/720kb/angular-datepicker","commit_stats":null,"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fangular-datepicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fangular-datepicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fangular-datepicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/720kb%2Fangular-datepicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/720kb","download_url":"https://codeload.github.com/720kb/angular-datepicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234909086,"owners_count":18905504,"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","angular-directives","angularjs","datepicker","directive"],"created_at":"2024-07-31T19:00:55.116Z","updated_at":"2025-10-01T23:30:34.774Z","avatar_url":"https://github.com/720kb.png","language":"HTML","readme":"Angular Datepicker\n==================\n![Angular datepicker calendar](http://i.imgur.com/jKfADtA.png)\n\n[![Join the chat at https://gitter.im/720kb/angular-datepicker](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/720kb/angular-datepicker?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\nAngular datepicker is an angularjs directive that generates a datepicker calendar on your input element.\n\nThe Angularjs Datepicker is developed by [720kb](http://720kb.net).\n\n## Requirements\n\nAngularJS v1.3+\n\n### Browser support\n\nChrome | Firefox | IE | Opera | Safari\n--- | --- | --- | --- | --- |\n ✔ | ✔ | IE9 + | ✔ | ✔ |\n\n\n## Load\n\nTo use the directive, include the Angular Datepicker's javascript and css files in your web page:\n\n```html\n\u003c!DOCTYPE HTML\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003clink href=\"src/css/angular-datepicker.css\" rel=\"stylesheet\" type=\"text/css\" /\u003e\n\u003c/head\u003e\n\u003cbody ng-app=\"app\"\u003e\n  //.....\n  \u003cscript src=\"src/js/angular-datepicker.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Installation\n\n#### Bower\n\n```\n$ bower install angularjs-datepicker --save\n```\n#### Npm\n\n```\n$ npm install angularjs-datepicker --save\n```\n\n_then load the js files in your html_\n\n### Add module dependency\n\nAdd the 720kb.datepicker module dependency\n\n```js\nangular.module('app', [\n  '720kb.datepicker'\n ]);\n```\n\nCall the directive wherever you want in your html page\n\n```html\n\u003cdatepicker\u003e\n  \u003cinput ng-model=\"date\" type=\"text\"/\u003e\n\u003c/datepicker\u003e\n```\n\u003e By default the ng-model will show a Javascript Date() Object inside your input, you can use the options below to set your preferred date format to.\n\n\n## DOC\n\nOption | Type | Default | Description\n------------- | ------------- | ------------- | -------------\ndate-set=\"\" | String | false | Set a default date to show and init datepicker\n |  | | **tip:** _Do not use same scope for ng-model=\"date\" and date-set=\"{{date}}\", this example is wrong._\n |  | | **tip:** _If you want to pass a Date Object inside do like this date-set=\"{{newDateObject.toString()}}\"_\n |  | | **tip:** _Consider that `date-set=\"{{myDate}}\"` equals to `new Date(attr.dateSet)`, be sure the date you pass inside date-set=\"\" is always in a correct ISO format, or adjust it based on the browser locale to avoid problems with that.\"._\ndate-format=\"\" | String | String(new Date()) | Set the date format you want to use, see the list [here](https://docs.angularjs.org/api/ng/filter/date)\n |  | | **tip:** _Be always sure to use a recognized format, maybe try first of all to pass it through new Date('...') and see if it's recognized_\ndate-min-limit=\"\" | String | false | Set a minimum date limit - you can use all the accepted date formats by the javascript `new Date()`\ndate-max-limit=\"\" | String | false | Set a maximum date limit - you can use all the accepted date formats by the javascript `new Date()`\ndate-set-hidden=\"\" | String(Boolean) | false | Set the default date to be shown only in calendar and not in the input field\ndate-disabled-dates=\"\" | String([Date(), Date(), ...]) | false | Disable specific dates using an _Array_ of dates.\ndate-enabled-dates=\"\" | String([Date(), Date(), ...]) | false | Enable only the specific dates using an _Array_ of dates.\ndate-disabled-weekdays=\"\" | String(1, 5, ...]) | false | Disable specific weekdays using an _Array_ of weeks number\ndate-refocus=\"\" | String(Boolean) | false | Set the datepicker to re-focus the input after selecting a date\ndate-typer=\"\" | String(Boolean) | false | Set the datepicker to update calendar date when user is typing a date, see validation [tips](#date-validation)\ndate-week-start-day=\"\" | String(Number) | 0 | Set the first day of the week. Must be an integer between 0 (Sunday) and 6 (Saturday). (e.g. 1 for Monday)\ndatepicker-class=\"\" | String('class1 class2 class3') | false | Set custom class/es for the datepicker calendar\ndatepicker-append-to=\"\" | String('#id','.classname', 'body') | false | Append the datepicker to #id or  .class element or to body\ndatepicker-toggle=\"\" | String(Boolean) | true | Set the datepicker to toggle its visibility on focus and blur \n| | | **tip:** Best is to use `pointer-events: none;` on your input if you don't want the user to toggle the calendar visibility.\ndatepicker-show=\"\" | String | false | Trigger the datepicker visibility, if true datepicker is shown if false it is hidden\n |  | | **tip:** _Do not mix it with datepicker-toggle for a more stable behavior_\ndatepicker-mobile=\"\" | String | true | Set to `false` to force override of mobile styles. Especially useful for using desktop-style pagination control in mobile apps.\n\n## Options\nAngular datepicker allows you to use some options via `attribute` data\n\n#### Custom titles\n\nYou can set the titles for the month and year selectors with the **date-year-title=\"\"** and **date-month-title=\"\"** data attributes (default to is _\"select month\"_ and _\"select year\"_)\n\n```html\n\u003cdatepicker date-month-title=\"selected year\"\u003e\n    \u003cinput ng-model=\"date\"/\u003e\n\u003c/datepicker\u003e\n\n\u003cdatepicker date-year-title=\"selected title\"\u003e\n    \u003cinput ng-model=\"date\"/\u003e\n\u003c/datepicker\u003e\n```\n\n#### Highlight today day in  calendar\nTo highlight or style the today day in the calendar just use its own CSS class (`._720kb-datepicker-today`) like this:\n\n```css\n._720kb-datepicker-calendar-day._720kb-datepicker-today {\n  background:red;\n  color:white;\n}\n```\n\n#### Custom buttons\nYou can customize the calendar navigation buttons content, let's make an example while using [FontAwesome](http://fontawesome.io)\n\n```html\n\u003cdatepicker button-prev=\"\u003ci class='fa fa-arrow-left'\u003e\u003c/i\u003e\" button-next=\"\u003ci class='fa fa-arrow-right'\u003e\u003c/i\u003e\"\u003e\n  \u003cinput ng-model=\"date\" type=\"text\"/\u003e\n\u003c/datepicker\u003e\n```\n\n#### Custom buttons titles for arrows\nYou can also set the titles for the left and right arrows with **button-next-title=\"\"** for the right and **button-prev-title=\"\"** for the left. By default they are labeled _\"next\"_ and _\"prev\"_.\n\n```html\n\u003cdatepicker button-prev-title=\"previous month\"\u003e\n    \u003cinput ng-model=\"date\"/\u003e\n\u003c/datepicker\u003e\n\n\u003cdatepicker button-next-title=\"next month\"\u003e\n    \u003cinput ng-model=\"date\" type=\"text\"/\u003e\n\u003c/datepicker\u003e\n```\n\n#### Input as grandchild\nSometimes you cannot put date input as a first child of datepicker. In this case you may use `selector=\"\"` to point to the CSS class of the input. Below example with using Twitter Bootstrap and FontAwesome\n\n```html\n\u003cdatepicker date-format=\"yyyy-MM-dd\" selector=\"form-control\"\u003e\n    \u003cdiv class=\"input-group\"\u003e\n        \u003cinput class=\"form-control\" placeholder=\"Choose a date\"/\u003e\n        \u003cspan class=\"input-group-addon\" style=\"cursor: pointer\"\u003e\n        \u003ci class=\"fa fa-lg fa-calendar\"\u003e\u003c/i\u003e\n        \u003c/span\u003e\n    \u003c/div\u003e\n\u003c/datepicker\u003e\n```\n#### Manually show and hide datepicker\nSometimes you want to (manually/programmatically) show or hide the datepicker, this can be achieved using `datepicker-show` attribute, if `false`, datepicker is hidden, if `true`, datepicker is shown\n\n```javascript\n.controller('TestController', ['$scope', '$interval', function TestController($scope, $interval) {\n    $scope.visibility = true;\n\n    $interval(function setInterval() {\n      //toggling manually everytime\n      $scope.visibility = !$scope.visibility;\n    }, 3500);\n  }]);\n```\n```html\n  \u003cdatepicker ng-controller=\"TestController\" datepicker-show=\"{{visibility}}\"\u003e\n      \u003cinput ng-model=\"date3\" type=\"text\" class=\"angular-datepicker-input\"/\u003e\n    \u003c/datepicker\u003e\n```\n_tip: you should use this attribute together with `datepicker-toggle=\"false\" , for a better stable behavior of the datepicker_\n\n#### Input as grandchild\nSometimes you cannot put date input as a first child of datepicker. In this case you may use `selector=\"\"` to point to the CSS class of the input. Below example with using Twitter Bootstrap and FontAwesome\n\n```html\n\u003cdatepicker date-format=\"yyyy-MM-dd\" selector=\"form-control\"\u003e\n    \u003cdiv class=\"input-group\"\u003e\n        \u003cinput class=\"form-control\" placeholder=\"Choose a date\"/\u003e\n        \u003cspan class=\"input-group-addon\" style=\"cursor: pointer\"\u003e\n        \u003ci class=\"fa fa-lg fa-calendar\"\u003e\u003c/i\u003e\n        \u003c/span\u003e\n    \u003c/div\u003e\n\u003c/datepicker\u003e\n```\n### Tips\n\n#### Date validation\nIf you want to validate the input, while user is typing for example, you just have to refer to the `ngModel`.\nAs long as you use something like:\n```html\n\u003cdiv ng-controller=\"MyCtrl as ctrl\"\u003e\n\u003cinput datepicker type=\"text\" ng-model=\"myDate\"/\u003e\n\u003c/div\u003e\n```\nYou can show validation errors simply validating the ngModel, as you would do for any other type of input, for example:\n```javascript\n.controller('Ctrl', ['$scope', function ($scope) {\n  var liveDate;\n\n  $scope.$watch('myDate', function (value) {\n    try {\n     liveDate = new Date(value);\n    } catch(e) {}\n\n    if (!liveDate) {\n\n      $scope.error = \"This is not a valid date\";\n    } else {\n      $scope.error = false;\n    }\n  });\n}]);\n```\n\nThen your final html:\n```html\n\u003cdiv ng-controller=\"MyCtrl as ctrl\"\u003e\n\u003cinput type=\"text\" ng-model=\"myDate\" datepicker/\u003e\n\u003cdiv ng-show=\"ctrl.error\"\u003e{{ctrl.error}}\u003c/div\u003e\n\u003c/div\u003e\n```\n\n\n### Example\n\n[Live demo](https://720kb.github.io/angular-datepicker)\n\n## Themes :art:\nYou can edit the default Css file `angular-datepicker.css` if you want to make a new theme for the datepicker, then just add it to the ```themes``` dir and PR!\n\nMore about it https://github.com/720kb/angular-datepicker/tree/master/themes.\n\nHere is an example of a [Dark Theme](http://codepen.io/45kb/pen/bjslv) made using custom Css.\n\n***_Please note that the example may not be uptodate with the latest angular and/or module version_\n\n## Contributing\n\nWe will be much grateful if you help us making this project to grow up.\nFeel free to contribute by forking, opening issues, pull requests etc.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Filippo Oretti, Dario Andrei\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["HTML"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F720kb%2Fangular-datepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F720kb%2Fangular-datepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F720kb%2Fangular-datepicker/lists"}