{"_id":"angularjs-bootstrap-datetimepicker","_rev":"3-06fc223adaaa63431f791a024265c3ac","name":"angularjs-bootstrap-datetimepicker","description":"This directive allows you to add a datetime-picker to your form elements.","dist-tags":{"latest":"1.1.4"},"versions":{"1.1.4":{"name":"angularjs-bootstrap-datetimepicker","version":"1.1.4","description":"This directive allows you to add a datetime-picker to your form elements.","keywords":["angular","calendar","date picker","date","directive","moment","time picker","time"],"author":{"name":"https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/graphs/contributors"},"bugs":{"url":"https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/issues"},"license":"MIT","homepage":"http://dalelotts.github.io/angularjs-bootstrap-datetimepicker","main":"index.js","style":"src/css/datetimepicker.css","scss":"src/scss/datetimepicker.scss","dependencies":{"angular":"^1.6.4","moment":"^2.18.1"},"devDependencies":{"angular-date-time-input":"^1.2.1","angular-mocks":"^1.6.4","autoprefixer":"^7.1.1","bootstrap":"^3.3.7","commitizen":"^2.9.6","coveralls":"^2.13.1","csscomb":"^4.1.0","csslint":"^1.0.5","cz-conventional-changelog":"^2.0.0","del":"^2.2.2","eslint":"^3.19.0","gulp":"^3.9.1","gulp-angular-templatecache":"^2.0.0","gulp-csscomb":"^3.0.8","gulp-csslint":"^1.0.0","gulp-htmlmin":"^3.0.0","gulp-jscs":"^4.0.0","gulp-jshint":"^2.0.4","gulp-postcss":"^7.0.0","gulp-sass":"^3.1.0","gulp-scss-lint":"^0.4.0","gulp-scss-lint-stylish":"^1.0.1","gulp-sourcemaps":"^2.6.0","gulp-standard":"^10.0.0","gulp-stylelint":"^3.9.0","jasmine-core":"^2.6.2","jquery":"^3.2.1","jshint":"^2.9.4","jshint-stylish":"^2.2.1","karma":"^1.7.0","karma-chrome-launcher":"^2.1.1","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.0.1","karma-jasmine":"^1.1.0","karma-phantomjs-launcher":"^1.0.4","karma-threshold-reporter":"^0.1.15","karma-webpack":"^2.0.3","lodash":"^4.17.4","matchdep":"^1.0.1","moment-timezone":"^0.5.13","phantomjs-prebuilt":"^2.1.14","plato":"^1.7.0","run-browser":"^2.0.2","semantic-release":"^6.3.6","standard":"^10.0.2","stylelint-config-standard":"^16.0.0","tape":"^4.6.3","webpack":"^2.6.1"},"scripts":{"css-lint":"gulp css-lint","coverage:upload":"cat build/coverage/lcov.info | coveralls","semantic-release":"semantic-release pre && npm publish && semantic-release post","scss":"gulp scss","templatecache":"gulp templatecache","test":"npm run test-browserify && npm run test-webpack && gulp","test-browserify":"run-browser test/commonjs/browserify.test.js -b","test-webpack":"karma start test/webpack/karma.conf.js"},"repository":{"type":"git","url":"git+https://github.com/dalelotts/angularjs-bootstrap-datetimepicker.git"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"5a7ad331452575df0d43f6f6af1a8b5cdf393457","_id":"angularjs-bootstrap-datetimepicker@1.1.4","_shasum":"88a4fea0e46fe8f4561e2ac32964ff589e5464a9","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"dalelotts","email":"dale@dalelotts.com"},"dist":{"shasum":"88a4fea0e46fe8f4561e2ac32964ff589e5464a9","tarball":"https://registry.npmjs.org/angularjs-bootstrap-datetimepicker/-/angularjs-bootstrap-datetimepicker-1.1.4.tgz","integrity":"sha512-28Nsr4fUljVzabKAQb5mO6G8+5YI73+d5iRp3pOl9ywPVojiCZSsRPk5urb2vHxqABgIs2nR5ZQxOnuwLMy/MQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNbUx5u+mSR7F1LjM5+lkuxZ5D8dysbOtzjCWN/FhW4AiAxwFARDBQvkdxbLr1z3K0qLWCJWDwayiD1ygQ5A3dP9Q=="}]},"maintainers":[{"name":"dalelotts","email":"dale@dalelotts.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/angularjs-bootstrap-datetimepicker-1.1.4.tgz_1495756717852_0.4925182273145765"},"directories":{}}},"readme":"# Angular bootstrap date & time picker\n\nNative AngularJS datetime picker directive styled by Twitter Bootstrap 3\n\n[![Join the chat at https://gitter.im/dalelotts/angularjs-bootstrap-datetimepicker](https://badges.gitter.im/dalelotts/angularjs-bootstrap-datetimepicker.svg)](https://gitter.im/dalelotts/angularjs-bootstrap-datetimepicker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![MIT License][license-image]][license-url]\n[![Build Status](https://travis-ci.org/dalelotts/angularjs-bootstrap-datetimepicker.png?branch=master)](https://travis-ci.org/dalelotts/angularjs-bootstrap-datetimepicker)\n[![Coverage Status](https://coveralls.io/repos/github/dalelotts/angularjs-bootstrap-datetimepicker/badge.svg?branch=master)](https://coveralls.io/github/dalelotts/angularjs-bootstrap-datetimepicker?branch=master)\n[![Dependency Status](https://david-dm.org/dalelotts/angularjs-bootstrap-datetimepicker.svg)](https://david-dm.org/dalelotts/angularjs-bootstrap-datetimepicker)\n[![devDependency Status](https://david-dm.org/dalelotts/angularjs-bootstrap-datetimepicker/dev-status.png)](https://david-dm.org/dalelotts/angularjs-bootstrap-datetimepicker#info=devDependencies)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Known Vulnerabilities](https://snyk.io/test/npm/angularjs-bootstrap-datetimepicker/badge.svg)](https://snyk.io/test/npm/angularjs-bootstrap-datetimepicker)\n[![PayPal donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=F3FX5W6S2U4BW&lc=US&item_name=Dale%20Lotts&item_number=angular%2dbootstrap%2ddatetimepicker&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted \"Donate one-time to this project using Paypal\")\n<a href=\"https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Fabout.twitter.com%2Fresources%2Fbuttons&amp;text=Check%20out%20this%20%23AngularJS%20directive%20that%20makes%20it%20dead%20simple%20for%20users%20to%20select%20dates%20%26%20times&amp;tw_p=tweetbutton&amp;url=https%3A%2F%2Fgithub.com%2Fdalelotts%2Fangularjs-bootstrap-datetimepicker&amp;via=dalelotts\" target=\"_blank\">\n  <img src=\"http://jpillora.com/github-twitter-button/img/tweet.png\"></img>\n</a>\n\n[Home / demo page](http://dalelotts.github.io/angularjs-bootstrap-datetimepicker/)\n\n## Support the project\nI know this is a tiny directive but many people use it in production (high 5 to all of us) - if you happen to use this directive please click the star button (at the top of the page) - it means a lot to all the contributors.\n\n## Overriding html template\n\nIf you want to override the template used by this directive, simply populate the ```$templateCache``` with your own template.\n\n```JavaScript\n $templateCache.put('templates/datetimepicker.html', '<div>...your custom template here...</div>')\n```\n\n# Formatting the date in an input box\n\nUse the [angular-date-time-input](https://github.com/dalelotts/angular-date-time-input) directive to format the \ndisplay of a date in an input box or allow users to enter a valid date with the keyboard.\n\n# Bower\n\nThis project no longer supports bower. If you are using wiredep, you can add the following to your \nbower.json file to allow wiredep to use this directive.\n\n```json\n  \"overrides\": {\n    \"angularjs-bootstrap-datetimepicker\": {\n      \"main\": [\n        \"src/js/datetimepicker.js\",\n        \"src/js/datetimepicker.templates.js\",\n        \"src/css/datetimepicker.css\"\n      ],\n      \"dependencies\": {\n        \"angular\": \"^1.x\",\n        \"moment\": \"^2.x\"\n      }\n    }\n  }\n```\n\n# Bootstrap Dropdown with JQuery 3\n\nIf you see this error: `Uncaught Error: Syntax error, unrecognized expression: #`, it is because you are using Bootstrap \ndropdown's with JQuery 3 and the HTML from the the official Bootstrap documentation. \n\nFortunately, you can get Bootstrap dropdowns to work with JQuery 3 by making a minor change to the HTML!\n\n## Bootstrap dropdown using jQuery 2\nThis example will not work with will not work with jQuery3.\n ```html\n <div class=\"dropdown\">\n     <a class=\"dropdown-toggle\" id=\"dLabel\" role=\"button\" data-toggle=\"dropdown\" data-target=\"#\" href=\"#\">\n         Click here to show calendar\n     </a>\n     <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n         <datetimepicker data-ng-model=\"data.date\"\n                         data-datetimepicker-config=\"{ dropdownSelector: '.dropdown-toggle' }\"></datetimepicker>\n     </ul>\n </div>\n ```\n \n ## Bootstrap dropdown using jQuery 3\n To use jQuery 3 with Bootstrap 3, you need to change the `data-toggle` to a selector that will select the parent `div.dropdown` element.\n \n If you only have one drop down on the page, the change is very simple.\n 1. Change `data-toggle=\"#\"` to `data-toggle=\".dropdown\"`.\n \n To support multiple drop down's on a page, you need to make two changes:\n 1. Add a new class to the `div.dropdown` element (`dropdown1-parent` in the below example). This will be used as a selector in the `data-target` attribute.\n 2. Change `data-toggle=\"#\"` to `data-target=\".dropdown1-parent\" `. \n \n  ```html\n  <div class=\"dropdown dropdown1-parent\">\n      <a class=\"dropdown-toggle\" id=\"dropdown1\" role=\"button\" data-toggle=\"dropdown\" data-target=\".dropdown1-parent\" href=\"#\">\n          Click here to show calendar\n      </a>\n      <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n          <datetimepicker data-ng-model=\"data.date\"\n                          data-datetimepicker-config=\"{ dropdownSelector: '.dropdown-toggle' }\"></datetimepicker>\n      </ul>\n  </div>\n  ```\n**NB**: All examples in this project now use the jQuery 3 HMTL because it also works with jQuery 2.\n\n# Dependencies\n\nRequires:\n * AngularJS 1.4.x or higher (1.0.x will not work)\n * moment.js 2.8.3 or higher for date parsing and formatting\n * bootstrap's glyphicons for arrows (Can be overridden in css)\n \noptional:\n * bootstrap's dropdown component (`dropdowns.less` or `bootstrap.css` )\n * bootstrap's javascript (`bootstrap.js` )\n\n# Testing\nThis directive was written using TDD and all enhancements and changes have related tests.\n\nWe use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use gulp:\n\n```shell\nnpm install\nnpm test\n```\n\nThe karma task will try to open Chrome as a browser in which to run the tests.\nMake sure Chrome is available or change the browsers setting in karma.config.js\n\n# Usage\nWe use npm for dependency management, run\n\n```shell\nnpm install --save angularjs-bootstrap-datetimepicker\n```\n\nThis will copy the angularjs-bootstrap-datetimepicker files into your components folder, along with its dependencies.\n\nAdd the css:\n\n```html\n<link rel=\"stylesheet\" href=\"node_modules/bootstrap/dist/css/bootstrap.css\">\n<link rel=\"stylesheet\" href=\"node_modules/angularjs-bootstrap-datetimepicker/src/css/datetimepicker.css\"/>\n```\n\nLoad the script files in your application:\n```html\n<script type=\"text/javascript\" src=\"node_modules/moment/moment.js\"></script>\n<script type=\"text/javascript\" src=\"node_modules/angular/angular.js\"></script>\n<script type=\"text/javascript\" src=\"node_modules/angularjs-bootstrap-datetimepicker/src/js/datetimepicker.js\"></script>\n<script type=\"text/javascript\" src=\"node_modules/angularjs-bootstrap-datetimepicker/src/js/datetimepicker.templates.js\"></script>\n```\n\nAdd the date module as a dependency to your application module:\n\n```html\nvar myAppModule = angular.module('MyApp', ['ui.bootstrap.datetimepicker'])\n```\n\nApply the directive to your form elements:\n\n```html\n<datetimepicker data-ng-model=\"data.date\"></datetimepicker>\n```\n\n## Callback functions\n\n### before-render\nAttribute on datetimepicker element\n\nIf the value of the before-render attribute is a function, the date time picker will call this function\nbefore rendering a new view, passing in data about the view.\n\n```html\n<datetimepicker data-ng-model=\"data.date\" data-before-render=\"beforeRender($view, $dates, $leftDate, $upDate, $rightDate)\"></datetimepicker>\n```\nThis function will be called every time a new view is rendered.\n```javascript\n$scope.beforeRender = function ($view, $dates, $leftDate, $upDate, $rightDate) {\n    var index = Math.floor(Math.random() * $dates.length);\n    $dates[index].selectable = false;\n}\n```\n\nThe following parameters are supplied by this directive :\n * '$view' the name of the view to be rendered\n * '$dates' a (possibly empty) array of DateObject's (see source) that the user can select in the view.\n * '$leftDate' the DateObject selected if the user clicks the left arrow.\n * '$upDate' the DateObject selected if the user clicks the text between the arrows.\n * '$rightDate' the DateObject selected if the user clicks the right arrow.\n\n\n```\nDateObject {\n    utcDateValue: Number - UTC time value of this date object. It does NOT contain time zone information so take that into account when comparing to other dates (or use localDateValue function).\n    localDateValue: FUNCTION that returns a Number - local time value of this date object - same as moment.valueOf() or Date.getTime().\n    display: String - the way this value will be displayed on the calendar.\n    active: true | false | undefined - indicates that date object is part of the model value.\n    selectable: true | false | undefined - indicates that date value is selectable by the user.\n    past: true | false | undefined - indicates that date value is prior to the date range of the current view.\n    future: true | false | undefined - indicates that date value is after the date range of the current view.\n}\n```\nSetting the .selectable property of a DateObject to false will prevent the user from being able to select that date value.\n\n### on-set-time\nAttribute on datetimepicker element\n\nIf the value of the on-set-time attribute is a function, the date time picker will call this function\npassing in the selected value and previous value.\n```html\n<datetimepicker data-ng-model=\"data.date\" data-on-set-time=\"onTimeSet(newDate, oldDate)\"></datetimepicker>\n```\nThis function will be called when the user selects a value on the minView.\n```javascript\n$scope.onTimeSet = function (newDate, oldDate) {\n    console.log(newDate);\n    console.log(oldDate);\n}\n```\n\ndata-on-set-time=\"onTimeSet()\"  <-- This will work\n\ndata-on-set-time=\"onTimeSet\"    <-- **This will NOT work, the ()'s are required**\n\n\n## Configuration Options\n***NOTE*** The configuration options are not attributes on the element but rather members of the configuration object,\nwhich is specified in the data-datetimepicker-config attribute.\n\n```html\n<datetimepicker data-ng-model=\"data.date\" data-datetimepicker-config=\"{ dropdownSelector: '.dropdown-toggle' }\"></datetimepicker>\n```\n\n### startView\n\nString.  Default: ```'day'```\n\nThe view that the datetimepicker should show when it is opened.\nAccepts values of :\n * ```'minute'``` for the minute view\n * ```'hour'``` for the hour view\n * ```'day'``` for the day view (the default)\n * ```'month'``` for the 12-month view\n * ```'year'``` for the 10-year overview. Useful for date-of-birth datetimepickers.\n\n### minView\n\nString. ```'minute'```\n\nThe lowest view that the datetimepicker should show.\n\nAccepts the same values as startView.\n\n### minuteStep\n\nNumber.  Default: ```5```\n\nThe increment used to build the hour view. A button is created for each <code>minuteStep</code> minutes.\n\n### configureOn\n\nString. Default: ```null```\n\nCauses the date/time picker to re-read its configuration when the specified event is received.\n\nFor example, perhaps the startView option in the configuration has changed and you would like the \nnew configuration to be used. You can $broadcast the event to cause this directive to use the new configuration. \n\n### renderOn\n\nString. Default: ```null```\n\nCauses the date/time picker to re-render its view when the specified event is received.\n\nFor example, if you want to disable any dates or times that are in the past. \nYou can $broadcast the event at an interval to disable times in the past (or any other time valid dates change).\n\n### modelType\n\nString. Default: ```'Date'```\n\nSpecifies the data type to use when storing the selected date in the model. \n\nAccepts any string value, but the following values have special meaning (these values are case sensitive) :\n * ```'Date'``` stores a Date instance in the model. Will accept Date, moment, milliseconds, and ISO 8601 strings as initial input from the model \n * ```'moment'``` stores a moment instance in the model. Accepts the same initial values as ```Date```\n * ```'milliseconds'``` store the epoch milliseconds (since 1-1-1970) in the model. Accepts the same initial values as ```Date```\n\nAny other value is considered a format string. \n\nWhen accepting values from, and saving values to the model, this directive tries to be as flexible as possible.\nDates, moments, and milliseconds are all accepted as input no matter what you specify for ```modelType```.\nHowever, strings are problematic and often lose timezone information, so use caution when storing strings. \n\nIf you must use a string, be aware that the format stored in the model must exactly match the format specified in ```modelType```.\nFor example, the value in the model is ```'2015-12-31'``` then using ```modelType: 'MM-DD-YYYY'``` will cause an exception. \n \nNOTA BENE: If the only reason you are storing strings is to have it properly formatted when displaying to the user,\nplease review the documentation on ngModelController $formatters and $parsers. These allow you to store a value in the model\nbut display it formatted as you like in the view. In other words, stop it!  =)\n\n### screenReader\nThe next and previous arrows on the directive had hidden (when useing bootstrap.css) text for screen readers. \nIt also provide some default translations for various languages. However, if you need another translation, you can specify \nthe translations in the configuration.\n\nThe screenReader option must be an object with ```previous``` and ```next``` properties.\n\n```html\n<datetimepicker data-ng-model=\"data.date\" data-datetimepicker-config=\"{ screenReader: { 'previous': 'go previous', 'next': 'go next' }}\"></datetimepicker>\n```\n\n\n### dropdownSelector\n\nWhen used within a Bootstrap dropdown and jQuery, the selector specified in dropdownSelector will toggle the dropdown when a date/time is selected.\n\n**NOTE:** dropdownSelector **requires** jquery and bootstrap.js. If do not have these available do not specify this option. If you do, an error will\n be logged and this option will be removed.\n\n\n## Working with ng-model\nThe angularjs-bootstrap-datetimepicker directive requires ng-model and the picked date/time is automatically synchronized with the model value.\n\nThis directive also plays nicely with validation directives such as ng-required.\n\nThe angularjs-bootstrap-datetimepicker directive stores and expects the model value to be a standard javascript Date object.\n\n## ng-required directive\nIf you apply the required directive to element then the form element is invalid until a date is picked.\n\nNote: Remember that the ng-required directive must be explicitly set, i.e. to \"true\".\n\n## Examples\n\n### Inline component.\n\n```html\n<datetimepicker data-ng-model=\"data.date\" ></datetimepicker>\n```\n### Inline component with data bound to the page with the format specified via date filter:\n\n```html\n<datetimepicker data-ng-model=\"data.date\" ></datetimepicker>\n```\n```\n<p>Selected Date: {{ data.date | date:'yyyy-MM-dd HH:mm' }}</p>\n```\n\nDisplay formatting of the date field is controlled by Angular filters.\n\n### As a drop-down:\n\n```html\n<div class=\"dropdown\">\n    <a class=\"dropdown-toggle\" id=\"dLabel\" role=\"button\" data-toggle=\"dropdown\" data-target=\".dropdown\" href=\"#\">\n        Click here to show calendar\n    </a>\n    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n        <datetimepicker data-ng-model=\"data.date\"\n                        data-datetimepicker-config=\"{ dropdownSelector: '.dropdown-toggle' }\"></datetimepicker>\n    </ul>\n</div>\n```\nIn this example, the drop-down functionality is controlled by Twitter Bootstrap.\nThe <code>dropdownSelector</code> tells the datetimepicker which element is bound to the Twitter Bootstrap drop-down so\nthe drop-down is toggled closed after the user selects a date/time.\n\n### Drop-down component with associated input box.\n```html\n<div class=\"dropdown\">\n    <a class=\"dropdown-toggle\" id=\"dropdown\" role=\"button\" data-toggle=\"dropdown\" data-target=\".dropdown\" href=\"#\">\n      <div class=\"input-group\">\n        <input type=\"text\" id=\"date\" name=\"date\" class=\"form-control\" data-ng-model=\"data.date\">\n        <span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-calendar\"></i></span>\n      </div>\n    </a>\n    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n      <datetimepicker   data-ng-model=\"data.date\" \n                        data-datetimepicker-config=\"{ dropdownSelector: '#dropdown' }\"></datetimepicker>\n    </ul>\n  </div>\n```\nIn this example, the drop-down functionality is controlled by Twitter Bootstrap.\nThe <code>dropdownSelector</code> tells the datetimepicker which element is bound to the Twitter Bootstrap drop-down so\nthe drop-down is toggled closed after the user selects a date/time.\n\n### Restrict past dates from being selected\n\n```html\n<datetimepicker data-ng-model=\"startDate\" data-before-render=\"startDateBeforeRender($dates)\">\n</datetimepicker>\n```\n\nWe filter dates that are past today and set selectable to false\n\n```javascript\n$scope.startDateBeforeRender = function($dates) {\n  const todaySinceMidnight = new Date();\n    todaySinceMidnight.setUTCHours(0,0,0,0);\n    $dates.filter(function (date) {\n      return date.utcDateValue < todaySinceMidnight.getTime();\n    }).forEach(function (date) {\n      date.selectable = false;\n    });\n};\n```\n\n### Create a date range picker with validation controls\n```html\n<div class=\"dropdown form-group dropdown-start-parent\">\n    <label>Start Date</label>\n    <a class=\"dropdown-toggle\" id=\"dropdownStart\" role=\"button\" data-toggle=\"dropdown\" data-target=\".dropdown-start-parent\"\n       href=\"#\">\n        <div class=\"input-group date\">\n            <input type=\"text\" class=\"form-control\" data-ng-model=\"dateRangeStart\">\n            <span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-calendar\"></i></span>\n        </div>\n    </a>\n    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n        <datetimepicker data-ng-model=\"dateRangeStart\"\n                        data-datetimepicker-config=\"{ dropdownSelector: '#dropdownStart', renderOn: 'end-date-changed' }\"\n                        data-on-set-time=\"startDateOnSetTime()\"\n                        data-before-render=\"startDateBeforeRender($dates)\"></datetimepicker>\n    </ul>\n</div>\n\n<div class=\"dropdown form-group dropdown-end-parent\">\n    <label>End Date</label>\n    <a class=\"dropdown-toggle\" id=\"dropdownEnd\" role=\"button\" data-toggle=\"dropdown\" data-target=\".dropdown-end-parent\"\n       href=\"#\">\n        <div class=\"input-group date\">\n            <input type=\"text\" class=\"form-control\" data-ng-model=\"dateRangeEnd\">\n            <span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-calendar\"></i></span>\n        </div>\n    </a>\n    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">\n        <datetimepicker data-ng-model=\"dateRangeEnd\"\n                        data-datetimepicker-config=\"{ dropdownSelector: '#dropdownEnd', renderOn: 'start-date-changed' }\"\n                        data-on-set-time=\"endDateOnSetTime()\"\n                        data-before-render=\"endDateBeforeRender($view, $dates, $leftDate, $upDate, $rightDate)\"></datetimepicker>\n    </ul>\n</div>\n```\nIn this example, two elements are created : one for the start date and the second for the end date of the range.\n\n```JavaScript\n/* Bindable functions\n -----------------------------------------------*/\n$scope.endDateBeforeRender = endDateBeforeRender\n$scope.endDateOnSetTime = endDateOnSetTime\n$scope.startDateBeforeRender = startDateBeforeRender\n$scope.startDateOnSetTime = startDateOnSetTime\n\nfunction startDateOnSetTime () {\n  $scope.$broadcast('start-date-changed');\n}\n\nfunction endDateOnSetTime () {\n  $scope.$broadcast('end-date-changed');\n}\n\nfunction startDateBeforeRender ($dates) {\n  if ($scope.dateRangeEnd) {\n    var activeDate = moment($scope.dateRangeEnd);\n\n    $dates.filter(function (date) {\n      return date.localDateValue() >= activeDate.valueOf()\n    }).forEach(function (date) {\n      date.selectable = false;\n    })\n  }\n}\n\nfunction endDateBeforeRender ($view, $dates) {\n  if ($scope.dateRangeStart) {\n    var activeDate = moment($scope.dateRangeStart).subtract(1, $view).add(1, 'minute');\n\n    $dates.filter(function (date) {\n      return date.localDateValue() <= activeDate.valueOf()\n    }).forEach(function (date) {\n      date.selectable = false;\n    })\n  }\n}\n```\nThen in the controller two functions must be added. Each one is related to the concerned date. They update the selectable status of each displayed date based on the range values. The time is also taken into account.\n\n## Screen reader support\n\n## I18N / l10n support\n\nAll internationalization is handled by Moment.js, see Moment's documentation for details.\nIn most cases, all that is needed is a call to ```moment.locale(String)```\n\nOne exception is the title of the month view - moment does not (yet) have a localized format for month and year.\n\n```JavaScript\nmoment.locale('en');        // English\nmoment.locale('zh-cn');     // Simplified chinese\n```\n\n### First day of week\n\nThe first day of the week is also determined by moment's locale settings. For example, setting the locale to ```'fr'```\nwill cause Monday to be the first day of the week.  \n\n### Hour and minute formats\n\nThe format of hours and mintues is also determined by moment's locale settings.\n \nhours are displayed using 'll' as the format.\nminutes are displayed using 'lll' as the format. \n\nYou can change the format by setting moment to the desired locale, or creating a custom locale with the desired format.\n\n# Screen shots\n\n## Year view\n\n![Datetimepicker year view](https://raw.github.com/dalelotts/angularjs-bootstrap-datetimepicker/master/screenshots/year.png)\n\nThis view allows the user to select the year for the target date.\nIf the year view is the minView, the date will be set to midnight on the first day of the year\n\n## Month view\n\n![Datetimepicker month view](https://raw.github.com/dalelotts/angularjs-bootstrap-datetimepicker/master/screenshots/month.png)\n\nThis view allows the user to select the month in the selected year.\nIf the month view is the minView, the date will be set to midnight on the first day of the month.\n\n## Day view (Default)\n\n![Datetimepicker day view](https://raw.github.com/dalelotts/angularjs-bootstrap-datetimepicker/master/screenshots/day.png)\n\nThis view allows the user to select the the day of the month, in the selected month.\nIf the day view is the minView, the date will be set to midnight on the day selected.\n\n## Hour view\n\n![Datetimepicker hour view](https://raw.github.com/dalelotts/angularjs-bootstrap-datetimepicker/master/screenshots/hour.png)\n\nThis view allows the user to select the hour of the day, on the selected day.\nIf the hour view is the minView, the date will be set to the beginning of the hour on the day selected.\n\n## Minute view\n\n![Datetimepicker minute view](https://raw.github.com/dalelotts/angularjs-bootstrap-datetimepicker/master/screenshots/minute.png)\n\nThis view allows the user to select a specific time of day, in the selected hour.\nBy default, the time is displayed in 5 minute increments. The <code>minuteStep</code> property controls the increments of time displayed.\nIf the minute view is the minView, which is is by default, the date will be set to the beginning of the hour on the day selected.\n\n## Contributing\n\nSee [Contributing.md](https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/blob/master/.github/contributing.md)\n\n## License\n\nangularjs-bootstrap-datetimepicker is released under the MIT license and is copyright 2015 Knight Rider Consulting, Inc.. Boiled down to smaller chunks, it can be described with the following conditions.\n\n## It requires you to:\n\n* Keep the license and copyright notice included in angularjs-bootstrap-datetimepicker's CSS and JavaScript files when you use them in your works\n\n## It permits you to:\n\n* Freely download and use angularjs-bootstrap-datetimepicker, in whole or in part, for personal, private, company internal, or commercial purposes\n* Use angularjs-bootstrap-datetimepicker in packages or distributions that you create\n* Modify the source code\n* Grant a sublicense to modify and distribute angularjs-bootstrap-datetimepicker to third parties not included in the license\n\n## It forbids you to:\n\n* Hold the authors and license owners liable for damages as angularjs-bootstrap-datetimepicker is provided without warranty\n* Hold the creators or copyright holders of angularjs-bootstrap-datetimepicker liable\n* Redistribute any piece of angularjs-bootstrap-datetimepicker without proper attribution\n* Use any marks owned by Knight Rider Consulting, Inc. in any way that might state or imply that Knight Rider Consulting, Inc. endorses your distribution\n* Use any marks owned by Knight Rider Consulting, Inc. in any way that might state or imply that you created the Knight Rider Consulting, Inc. software in question\n\n## It does not require you to:\n\n* Include the source of angularjs-bootstrap-datetimepicker itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it\n* Submit changes that you make to angularjs-bootstrap-datetimepicker back to the angularjs-bootstrap-datetimepicker project (though such feedback is encouraged)\n\nThe full angularjs-bootstrap-datetimepicker license is located [in the project repository](https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/blob/master/LICENSE) for more information.\n\n\n## Donating\nSupport this project and other work by Dale Lotts via [gittip][gittip-dalelotts].\n\n[![Support via Gittip][gittip-badge]][gittip-dalelotts]\n\n[gittip-badge]: https://rawgithub.com/twolfson/gittip-badge/master/dist/gittip.png\n[gittip-dalelotts]: https://www.gittip.com/dalelotts/\n\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: LICENSE\n\n","maintainers":[{"name":"dalelotts","email":"dale@dalelotts.com"}],"time":{"modified":"2022-06-13T03:02:54.578Z","created":"2017-05-25T23:58:39.363Z","1.1.4":"2017-05-25T23:58:39.363Z"},"homepage":"http://dalelotts.github.io/angularjs-bootstrap-datetimepicker","keywords":["angular","calendar","date picker","date","directive","moment","time picker","time"],"repository":{"type":"git","url":"git+https://github.com/dalelotts/angularjs-bootstrap-datetimepicker.git"},"author":{"name":"https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/graphs/contributors"},"bugs":{"url":"https://github.com/dalelotts/angularjs-bootstrap-datetimepicker/issues"},"license":"MIT","readmeFilename":"README.md","users":{"dalelotts":true}}