Native AngularJS date & time picker directive styled by Twitter Bootstrap. Based on dalelotts/angularjs-bootstrap-datetimepicker.
! It is important to set locale in Luxon !
import {DateTime, Settings} from 'luxon';
Settings.defaultLocale = DateTime.local().resolvedLocaleOpts().locale;
<datetimepicker
[before-render="expression"]
[on-set-time="expression"]
[view-format="string"]
[datetimepicker-config="DateTimePickerConfiguration"]>
</datetimepicker>
Param | Type | Details | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
beforeRender
(optional)
|
expression |
If the value of the before-render attribute is a function, the date time picker will call this function before rendering a new view, passing in data about the view.
This function will be called every time a new view is rendered.
Setting the
|
||||||||||||||||||
onSetTime
(optional)
|
expression |
If the value of the on-set-time attribute is a function, the date time picker will call this function passing in the selected value and previous value.
This function will be called when the user selects a value on the minView.
|
||||||||||||||||||
viewFormat
(optional)
|
String |
Luxon format. If defined, ngModel will be formatted to this format. By default ngModel is formatted to ISO standard. |
||||||||||||||||||
datetimepickerConfig
(optional)
|
DateTimePickerConfiguration |
Datetime picker configuration. |
<main class="container-fluid">
<datetimepicker ng-model="datetime"></datetimepicker>
<div class="row">
<div class="col-lg-3">
<input class="form-control" disabled="true" ng-model="datetime">
</div>
</div>
</main>
luxon.Settings.defaultLocale = luxon.DateTime.local().resolvedLocaleOpts().locale;
angular.module('bootstrapDatetimePickerExample', ['bootstrap-datetimepicker']);