Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
feat(datepicker): add helpers for styling
Browse files Browse the repository at this point in the history
- Add helper variables available for custom templates to hook into for styling

Closes #5580
wesleycho committed Mar 4, 2016
1 parent 4b06b0b commit c15dcbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
@@ -310,12 +310,17 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
this.createDateObject = function(date, format) {
var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;
model = dateParser.fromTimezone(model, ngModelOptions.timezone);
var today = new Date();
today = dateParser.fromTimezone(today, ngModelOptions.timezone);
var time = this.compare(date, today);
var dt = {
date: date,
label: dateParser.filter(date, format),
selected: model && this.compare(date, model) === 0,
disabled: this.isDisabled(date),
current: this.compare(date, new Date()) === 0,
past: time < 0,
current: time === 0,
future: time > 0,
customClass: this.customClass(date) || null
};

0 comments on commit c15dcbd

Please sign in to comment.