Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

front-angular-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

front-angular-datepicker - npm Package Compare versions

Comparing version 2.0.4 to 2.1.3-2

test/spec/datePickerTest.js

54

app/scripts/datePicker.js

@@ -1,4 +0,2 @@

/* global moment */
'use strict';
var Module = angular.module('datePicker', []);

@@ -79,4 +77,10 @@

autoclose = attrs.autoClose === 'true',
// Either gets the 1st day from the attributes, or asks moment.js to give it to us as it is localized.
firstDay = attrs.firstDay && attrs.firstDay >= 0 && attrs.firstDay <= 6 ? parseInt(attrs.firstDay, 10) : moment().weekday(0).day();
// Either gets the 1st day from the attributes, or asks moment.js to give it to us as it is localized.
firstDay = attrs.firstDay && attrs.firstDay >= 0 && attrs.firstDay <= 6 ? parseInt(attrs.firstDay, 10) : moment().weekday(0).day(),
setDate,
prepareViewData,
isSame,
clipDate,
isNow,
inValidRange;

@@ -130,3 +134,3 @@ datePickerUtils.setParams(tz, firstDay);

function setDate(date) {
setDate = function (date) {
if (date) {

@@ -144,3 +148,3 @@ scope.model = date;

}
}
};

@@ -196,3 +200,3 @@ function update() {

function prepareViewData() {
prepareViewData = function () {
var view = scope.view,

@@ -227,4 +231,4 @@ date = scope.date,

var params = datePickerConfig.viewConfig[view],
dates = scope[params[0]],
compareFunc = params[1];
dates = scope[params[0]],
compareFunc = params[1];

@@ -246,3 +250,3 @@ for (i = 0; i < dates.length; i++) {

scope.classes = classes;
}
};

@@ -254,3 +258,3 @@ scope.next = function (delta) {

case 'year':
/*falls through*/
/*falls through*/
case 'month':

@@ -263,3 +267,3 @@ date.year(date.year() + delta);

case 'hours':
/*falls through*/
/*falls through*/
case 'minutes':

@@ -278,3 +282,3 @@ date.hours(date.hours() + delta);

function inValidRange(date) {
inValidRange = function (date) {
var valid = true;

@@ -288,9 +292,9 @@ if (minDate && minDate.isAfter(date)) {

return valid;
}
};
function isSame(date1, date2) {
isSame = function (date1, date2) {
return date1.isSame(date2, datePickerConfig.momentNames[scope.view]) ? true : false;
}
};
function clipDate(date) {
clipDate = function (date) {
if (minDate && minDate.isAfter(date)) {

@@ -303,5 +307,5 @@ return minDate;

}
}
};
function isNow(date, view) {
isNow = function (date, view) {
var is = true;

@@ -312,12 +316,12 @@

is &= ~~(now.minutes() / step) === ~~(date.minutes() / step);
/* falls through */
/* falls through */
case 'hours':
is &= now.hours() === date.hours();
/* falls through */
/* falls through */
case 'date':
is &= now.date() === date.date();
/* falls through */
/* falls through */
case 'month':
is &= now.month() === date.month();
/* falls through */
/* falls through */
case 'year':

@@ -327,3 +331,3 @@ is &= now.year() === date.year();

return is;
}
};

@@ -370,2 +374,2 @@ scope.prev = function (delta) {

};
}]);
}]);

@@ -1,5 +0,3 @@

/* global moment */
'use strict';
angular.module('datePicker').factory('datePickerUtils', function () {
'use strict';
var tz, firstDay;

@@ -20,3 +18,3 @@ var createNewDate = function (year, month, day, hour, minute) {

for (minute = 0 ; minute < 60 ; minute += step) {
for (minute = 0; minute < 60; minute += step) {
pushedDate = createNewDate(year, month, day, hour - offset, minute);

@@ -30,3 +28,3 @@ minutes.push(pushedDate);

var startYear = m.year(),
startMonth = m.month();
startMonth = m.month();

@@ -124,3 +122,3 @@ //Set date to the first day of the month

for (hour = 0 ; hour < 24 ; hour++) {
for (hour = 0; hour < 24; hour++) {
pushedDate = createNewDate(year, month, day, hour - offset, 0, false);

@@ -163,4 +161,4 @@ actualOffset = pushedDate.utcOffset() / 60;

var parentScope = scope,
nameArray = name.split('.'),
target, i, j = nameArray.length;
nameArray = name.split('.'),
target, i, j = nameArray.length;

@@ -192,3 +190,3 @@ do {

//Search scope ancestors for a matching function.
return this.scopeSearch(scope, name, function(target) {
return this.scopeSearch(scope, name, function (target) {
//Property must also be a function

@@ -200,3 +198,3 @@ return angular.isFunction(target);

//Search scope ancestors for a matching parameter.
return this.scopeSearch(scope, name, function() {
return this.scopeSearch(scope, name, function () {
//As long as the property exists, we're good

@@ -210,4 +208,4 @@ return true;

} else {
//If input is a moment, and we have no TZ info, we need to remove TZ
//info from the moment, otherwise the newly created moment will take
//If input is a moment, and we have no TZ info, we need to remove TZ
//info from the moment, otherwise the newly created moment will take
//the timezone of the input moment. The easiest way to do that is to

@@ -233,7 +231,17 @@ //take the unix timestamp, and use that to create a new moment.

},
//Checks if an event targeted at a specific picker, via either a string name, or an array of strings.
eventIsForPicker: function (targetIDs, pickerID) {
//Checks if an event targeted at a specific picker, via either a string name, or an array of strings.
return (angular.isArray(targetIDs) && targetIDs.indexOf(pickerID) > -1 || targetIDs === pickerID);
function matches(id) {
if (id instanceof RegExp) {
return id.test(pickerID);
}
return id === pickerID;
}
if (angular.isArray(targetIDs)) {
return targetIDs.some(matches);
}
return matches(targetIDs);
}
};
});
});

@@ -1,4 +0,2 @@

/* global moment */
'use strict';
var Module = angular.module('datePicker');

@@ -26,6 +24,6 @@

var dateChange = null,
pickerRangeID = element[0].id,
pickerIDs = [randomName(), randomName()],
createMoment = datePickerUtils.createMoment,
eventIsForPicker = datePickerUtils.eventIsForPicker;
pickerRangeID = element[0].id,
pickerIDs = [randomName(), randomName()],
createMoment = datePickerUtils.createMoment,
eventIsForPicker = datePickerUtils.eventIsForPicker;

@@ -78,6 +76,6 @@ scope.dateChange = function (modelName, newDate) {

var template = '<div><table class="date-range"><tr><td valign="top">' +
getTemplate(attrs, pickerIDs[0], 'start', false, scope.end) +
'</td><td valign="top">' +
getTemplate(attrs, pickerIDs[1], 'end', scope.start, false) +
'</td></tr></table></div>';
getTemplate(attrs, pickerIDs[0], 'start', false, scope.end) +
'</td><td valign="top">' +
getTemplate(attrs, pickerIDs[1], 'end', scope.start, false) +
'</td></tr></table></div>';

@@ -88,2 +86,2 @@ var picker = $compile(template)(scope);

};
}]);
}]);

@@ -1,6 +0,4 @@

/* global moment */
'use strict';
var PRISTINE_CLASS = 'ng-pristine',
DIRTY_CLASS = 'ng-dirty';
DIRTY_CLASS = 'ng-dirty';

@@ -12,19 +10,19 @@ var Module = angular.module('datePicker');

return '' +
'<div ' +
(id ? 'id="' + id + '" ' : '') +
'date-picker="' + attrs.ngModel + '" ' +
(attrs.view ? 'view="' + attrs.view + '" ' : '') +
(attrs.maxView ? 'max-view="' + attrs.maxView + '" ' : '') +
(attrs.maxDate ? 'max-date="' + attrs.maxDate + '" ' : '') +
(attrs.autoClose ? 'auto-close="' + attrs.autoClose + '" ' : '') +
(attrs.template ? 'template="' + attrs.template + '" ' : '') +
(attrs.minView ? 'min-view="' + attrs.minView + '" ' : '') +
(attrs.minDate ? 'min-date="' + attrs.minDate + '" ' : '') +
(attrs.partial ? 'partial="' + attrs.partial + '" ' : '') +
(attrs.step ? 'step="' + attrs.step + '" ' : '') +
(attrs.onSetDate ? 'date-change="' + attrs.onSetDate + '" ' : '') +
(attrs.ngModel ? 'ng-model="' + attrs.ngModel + '" ' : '') +
(attrs.firstDay ? 'first-day="' + attrs.firstDay + '" ' : '') +
(attrs.timezone ? 'timezone="' + attrs.timezone + '" ' : '') +
'class="date-picker-date-time"></div>';
'<div ' +
(id ? 'id="' + id + '" ' : '') +
'date-picker="' + attrs.ngModel + '" ' +
(attrs.view ? 'view="' + attrs.view + '" ' : '') +
(attrs.maxView ? 'max-view="' + attrs.maxView + '" ' : '') +
(attrs.maxDate ? 'max-date="' + attrs.maxDate + '" ' : '') +
(attrs.autoClose ? 'auto-close="' + attrs.autoClose + '" ' : '') +
(attrs.template ? 'template="' + attrs.template + '" ' : '') +
(attrs.minView ? 'min-view="' + attrs.minView + '" ' : '') +
(attrs.minDate ? 'min-date="' + attrs.minDate + '" ' : '') +
(attrs.partial ? 'partial="' + attrs.partial + '" ' : '') +
(attrs.step ? 'step="' + attrs.step + '" ' : '') +
(attrs.onSetDate ? 'date-change="' + attrs.onSetDate + '" ' : '') +
(attrs.ngModel ? 'ng-model="' + attrs.ngModel + '" ' : '') +
(attrs.firstDay ? 'first-day="' + attrs.firstDay + '" ' : '') +
(attrs.timezone ? 'timezone="' + attrs.timezone + '" ' : '') +
'class="date-picker-date-time"></div>';
},

@@ -57,19 +55,19 @@ format: 'YYYY-MM-DD HH:mm',

parentForm = element.inheritedData('$formController'),
views = $parse(attrs.views)(scope) || dateTimeConfig.views.concat(),
view = attrs.view || views[0],
index = views.indexOf(view),
dismiss = attrs.autoClose ? $parse(attrs.autoClose)(scope) : dateTimeConfig.autoClose,
picker = null,
pickerID = element[0].id,
position = attrs.position || dateTimeConfig.position,
container = null,
minDate = null,
minValid = null,
maxDate = null,
maxValid = null,
timezone = attrs.timezone || false,
eventIsForPicker = datePickerUtils.eventIsForPicker,
dateChange = null,
shownOnce = false,
template;
views = $parse(attrs.views)(scope) || dateTimeConfig.views.concat(),
view = attrs.view || views[0],
index = views.indexOf(view),
dismiss = attrs.autoClose ? $parse(attrs.autoClose)(scope) : dateTimeConfig.autoClose,
picker = null,
pickerID = element[0].id,
position = attrs.position || dateTimeConfig.position,
container = null,
minDate = null,
minValid = null,
maxDate = null,
maxValid = null,
timezone = attrs.timezone || false,
eventIsForPicker = datePickerUtils.eventIsForPicker,
dateChange = null,
shownOnce = false,
template;

@@ -87,4 +85,5 @@ if (index === -1) {

function parser(viewValue) {
if (viewValue.length === format.length) {
return viewValue;
var parsed = moment(viewValue, format);
if (parsed.isValid()) {
return parsed;
}

@@ -164,3 +163,3 @@ return undefined;

//Need to handle situation where the data changed but the picker is currently open.
//To handle this, we can create the inner picker with a random ID, then forward
//To handle this, we can create the inner picker with a random ID, then forward
//any events received to it.

@@ -235,3 +234,3 @@ } else {

var height = pos.height || element[0].offsetHeight;
picker.css({ top: (pos.top + height) + 'px', left: pos.left + 'px', display: 'block', position: position });
picker.css({top: (pos.top + height) + 'px', left: pos.left + 'px', display: 'block', position: position});
body.append(picker);

@@ -245,3 +244,3 @@ } else {

// element.before(picker);
picker.css({ top: element[0].offsetHeight + 'px', display: 'block' });
picker.css({top: element[0].offsetHeight + 'px', display: 'block'});
}

@@ -248,0 +247,0 @@ picker.bind('mousedown', function (evt) {

{
"name": "angular-datepicker",
"license": "MIT",
"version": "2.0.4",
"version": "2.1.3",
"main": [

@@ -6,0 +6,0 @@ "./dist/angular-datepicker.js",

@@ -1,4 +0,2 @@

'use strict';
(function(angular){
/* global moment */
(function (global, factory) {'use strict';var fnc;fnc = (typeof exports === 'object' && typeof module !== 'undefined') ? module.exports = factory(require('angular'), require('moment')) :(typeof define === 'function' && define.amd) ? define(['angular', 'moment'], factory) :factory(global.angular, global.moment);}(this, function (angular, moment) {
var Module = angular.module('datePicker', []);

@@ -23,4 +21,3 @@

},
step: 5,
firstDay: 0 //Sunday is the first day by default.
step: 5
});

@@ -81,3 +78,10 @@

autoclose = attrs.autoClose === 'true',
firstDay = attrs.firstDay && attrs.firstDay >= 0 && attrs.firstDay <= 6 ? parseInt(attrs.firstDay, 10) : datePickerConfig.firstDay;
// Either gets the 1st day from the attributes, or asks moment.js to give it to us as it is localized.
firstDay = attrs.firstDay && attrs.firstDay >= 0 && attrs.firstDay <= 6 ? parseInt(attrs.firstDay, 10) : moment().weekday(0).day(),
setDate,
prepareViewData,
isSame,
clipDate,
isNow,
inValidRange;

@@ -131,3 +135,3 @@ datePickerUtils.setParams(tz, firstDay);

function setDate(date) {
setDate = function (date) {
if (date) {

@@ -145,3 +149,3 @@ scope.model = date;

}
}
};

@@ -197,3 +201,3 @@ function update() {

function prepareViewData() {
prepareViewData = function () {
var view = scope.view,

@@ -228,4 +232,4 @@ date = scope.date,

var params = datePickerConfig.viewConfig[view],
dates = scope[params[0]],
compareFunc = params[1];
dates = scope[params[0]],
compareFunc = params[1];

@@ -247,3 +251,3 @@ for (i = 0; i < dates.length; i++) {

scope.classes = classes;
}
};

@@ -255,3 +259,3 @@ scope.next = function (delta) {

case 'year':
/*falls through*/
/*falls through*/
case 'month':

@@ -264,3 +268,3 @@ date.year(date.year() + delta);

case 'hours':
/*falls through*/
/*falls through*/
case 'minutes':

@@ -279,3 +283,3 @@ date.hours(date.hours() + delta);

function inValidRange(date) {
inValidRange = function (date) {
var valid = true;

@@ -289,9 +293,9 @@ if (minDate && minDate.isAfter(date)) {

return valid;
}
};
function isSame(date1, date2) {
isSame = function (date1, date2) {
return date1.isSame(date2, datePickerConfig.momentNames[scope.view]) ? true : false;
}
};
function clipDate(date) {
clipDate = function (date) {
if (minDate && minDate.isAfter(date)) {

@@ -304,5 +308,5 @@ return minDate;

}
}
};
function isNow(date, view) {
isNow = function (date, view) {
var is = true;

@@ -313,12 +317,12 @@

is &= ~~(now.minutes() / step) === ~~(date.minutes() / step);
/* falls through */
/* falls through */
case 'hours':
is &= now.hours() === date.hours();
/* falls through */
/* falls through */
case 'date':
is &= now.date() === date.date();
/* falls through */
/* falls through */
case 'month':
is &= now.month() === date.month();
/* falls through */
/* falls through */
case 'year':

@@ -328,3 +332,3 @@ is &= now.year() === date.year();

return is;
}
};

@@ -372,6 +376,5 @@ scope.prev = function (delta) {

}]);
/* global moment */
angular.module('datePicker').factory('datePickerUtils', function () {
var tz, firstDay;
var tz, firstDay;
var createNewDate = function (year, month, day, hour, minute) {

@@ -391,3 +394,3 @@ var utc = Date.UTC(year | 0, month | 0, day | 0, hour | 0, minute | 0);

for (minute = 0 ; minute < 60 ; minute += step) {
for (minute = 0; minute < 60; minute += step) {
pushedDate = createNewDate(year, month, day, hour - offset, minute);

@@ -401,3 +404,3 @@ minutes.push(pushedDate);

var startYear = m.year(),
startMonth = m.month();
startMonth = m.month();

@@ -495,3 +498,3 @@ //Set date to the first day of the month

for (hour = 0 ; hour < 24 ; hour++) {
for (hour = 0; hour < 24; hour++) {
pushedDate = createNewDate(year, month, day, hour - offset, 0, false);

@@ -534,4 +537,4 @@ actualOffset = pushedDate.utcOffset() / 60;

var parentScope = scope,
nameArray = name.split('.'),
target, i, j = nameArray.length;
nameArray = name.split('.'),
target, i, j = nameArray.length;

@@ -563,3 +566,3 @@ do {

//Search scope ancestors for a matching function.
return this.scopeSearch(scope, name, function(target) {
return this.scopeSearch(scope, name, function (target) {
//Property must also be a function

@@ -571,3 +574,3 @@ return angular.isFunction(target);

//Search scope ancestors for a matching parameter.
return this.scopeSearch(scope, name, function() {
return this.scopeSearch(scope, name, function () {
//As long as the property exists, we're good

@@ -581,4 +584,4 @@ return true;

} else {
//If input is a moment, and we have no TZ info, we need to remove TZ
//info from the moment, otherwise the newly created moment will take
//If input is a moment, and we have no TZ info, we need to remove TZ
//info from the moment, otherwise the newly created moment will take
//the timezone of the input moment. The easiest way to do that is to

@@ -604,9 +607,19 @@ //take the unix timestamp, and use that to create a new moment.

},
//Checks if an event targeted at a specific picker, via either a string name, or an array of strings.
eventIsForPicker: function (targetIDs, pickerID) {
//Checks if an event targeted at a specific picker, via either a string name, or an array of strings.
return (angular.isArray(targetIDs) && targetIDs.indexOf(pickerID) > -1 || targetIDs === pickerID);
function matches(id) {
if (id instanceof RegExp) {
return id.test(pickerID);
}
return id === pickerID;
}
if (angular.isArray(targetIDs)) {
return targetIDs.some(matches);
}
return matches(targetIDs);
}
};
});
/* global moment */
var Module = angular.module('datePicker');

@@ -634,6 +647,6 @@

var dateChange = null,
pickerRangeID = element[0].id,
pickerIDs = [randomName(), randomName()],
createMoment = datePickerUtils.createMoment,
eventIsForPicker = datePickerUtils.eventIsForPicker;
pickerRangeID = element[0].id,
pickerIDs = [randomName(), randomName()],
createMoment = datePickerUtils.createMoment,
eventIsForPicker = datePickerUtils.eventIsForPicker;

@@ -686,6 +699,6 @@ scope.dateChange = function (modelName, newDate) {

var template = '<div><table class="date-range"><tr><td valign="top">' +
getTemplate(attrs, pickerIDs[0], 'start', false, scope.end) +
'</td><td valign="top">' +
getTemplate(attrs, pickerIDs[1], 'end', scope.start, false) +
'</td></tr></table></div>';
getTemplate(attrs, pickerIDs[0], 'start', false, scope.end) +
'</td><td valign="top">' +
getTemplate(attrs, pickerIDs[1], 'end', scope.start, false) +
'</td></tr></table></div>';

@@ -697,5 +710,5 @@ var picker = $compile(template)(scope);

}]);
/* global moment */
var PRISTINE_CLASS = 'ng-pristine',
DIRTY_CLASS = 'ng-dirty';
DIRTY_CLASS = 'ng-dirty';

@@ -707,19 +720,19 @@ var Module = angular.module('datePicker');

return '' +
'<div ' +
(id ? 'id="' + id + '" ' : '') +
'date-picker="' + attrs.ngModel + '" ' +
(attrs.view ? 'view="' + attrs.view + '" ' : '') +
(attrs.maxView ? 'max-view="' + attrs.maxView + '" ' : '') +
(attrs.maxDate ? 'max-date="' + attrs.maxDate + '" ' : '') +
(attrs.autoClose ? 'auto-close="' + attrs.autoClose + '" ' : '') +
(attrs.template ? 'template="' + attrs.template + '" ' : '') +
(attrs.minView ? 'min-view="' + attrs.minView + '" ' : '') +
(attrs.minDate ? 'min-date="' + attrs.minDate + '" ' : '') +
(attrs.partial ? 'partial="' + attrs.partial + '" ' : '') +
(attrs.step ? 'step="' + attrs.step + '" ' : '') +
(attrs.onSetDate ? 'date-change="' + attrs.onSetDate + '" ' : '') +
(attrs.ngModel ? 'ng-model="' + attrs.ngModel + '" ' : '') +
(attrs.firstDay ? 'first-day="' + attrs.firstDay + '" ' : '') +
(attrs.timezone ? 'timezone="' + attrs.timezone + '" ' : '') +
'class="date-picker-date-time"></div>';
'<div ' +
(id ? 'id="' + id + '" ' : '') +
'date-picker="' + attrs.ngModel + '" ' +
(attrs.view ? 'view="' + attrs.view + '" ' : '') +
(attrs.maxView ? 'max-view="' + attrs.maxView + '" ' : '') +
(attrs.maxDate ? 'max-date="' + attrs.maxDate + '" ' : '') +
(attrs.autoClose ? 'auto-close="' + attrs.autoClose + '" ' : '') +
(attrs.template ? 'template="' + attrs.template + '" ' : '') +
(attrs.minView ? 'min-view="' + attrs.minView + '" ' : '') +
(attrs.minDate ? 'min-date="' + attrs.minDate + '" ' : '') +
(attrs.partial ? 'partial="' + attrs.partial + '" ' : '') +
(attrs.step ? 'step="' + attrs.step + '" ' : '') +
(attrs.onSetDate ? 'date-change="' + attrs.onSetDate + '" ' : '') +
(attrs.ngModel ? 'ng-model="' + attrs.ngModel + '" ' : '') +
(attrs.firstDay ? 'first-day="' + attrs.firstDay + '" ' : '') +
(attrs.timezone ? 'timezone="' + attrs.timezone + '" ' : '') +
'class="date-picker-date-time"></div>';
},

@@ -752,19 +765,19 @@ format: 'YYYY-MM-DD HH:mm',

parentForm = element.inheritedData('$formController'),
views = $parse(attrs.views)(scope) || dateTimeConfig.views.concat(),
view = attrs.view || views[0],
index = views.indexOf(view),
dismiss = attrs.autoClose ? $parse(attrs.autoClose)(scope) : dateTimeConfig.autoClose,
picker = null,
pickerID = element[0].id,
position = attrs.position || dateTimeConfig.position,
container = null,
minDate = null,
minValid = null,
maxDate = null,
maxValid = null,
timezone = attrs.timezone || false,
eventIsForPicker = datePickerUtils.eventIsForPicker,
dateChange = null,
shownOnce = false,
template;
views = $parse(attrs.views)(scope) || dateTimeConfig.views.concat(),
view = attrs.view || views[0],
index = views.indexOf(view),
dismiss = attrs.autoClose ? $parse(attrs.autoClose)(scope) : dateTimeConfig.autoClose,
picker = null,
pickerID = element[0].id,
position = attrs.position || dateTimeConfig.position,
container = null,
minDate = null,
minValid = null,
maxDate = null,
maxValid = null,
timezone = attrs.timezone || false,
eventIsForPicker = datePickerUtils.eventIsForPicker,
dateChange = null,
shownOnce = false,
template;

@@ -782,4 +795,5 @@ if (index === -1) {

function parser(viewValue) {
if (viewValue.length === format.length) {
return viewValue;
var parsed = moment(viewValue, format);
if (parsed.isValid()) {
return parsed;
}

@@ -859,3 +873,3 @@ return undefined;

//Need to handle situation where the data changed but the picker is currently open.
//To handle this, we can create the inner picker with a random ID, then forward
//To handle this, we can create the inner picker with a random ID, then forward
//any events received to it.

@@ -915,3 +929,3 @@ } else {

scope.$on('hidePicker', function () {
element[0].blur();
element.triggerHandler('blur');
});

@@ -931,3 +945,3 @@

var height = pos.height || element[0].offsetHeight;
picker.css({ top: (pos.top + height) + 'px', left: pos.left + 'px', display: 'block', position: position });
picker.css({top: (pos.top + height) + 'px', left: pos.left + 'px', display: 'block', position: position});
body.append(picker);

@@ -941,3 +955,3 @@ } else {

// element.before(picker);
picker.css({ top: element[0].offsetHeight + 'px', display: 'block' });
picker.css({top: element[0].offsetHeight + 'px', display: 'block'});
}

@@ -958,218 +972,112 @@ picker.bind('mousedown', function (evt) {

$templateCache.put('templates/datepicker.html',
"<div ng-switch=\"view\">\r" +
"\n" +
" <div ng-switch-when=\"date\">\r" +
"\n" +
" <table>\r" +
"\n" +
" <thead>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\r" +
"\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('month')\" ng-bind=\"date|mFormat:'YYYY MMMM':tz\"></th>\r" +
"\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-repeat=\"day in weekdays\" style=\"overflow: hidden\" ng-bind=\"day|mFormat:'ddd':tz\"></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </thead>\r" +
"\n" +
" <tbody>\r" +
"\n" +
" <tr ng-repeat=\"week in weeks\" ng-init=\"$index2 = $index\">\r" +
"\n" +
" <td ng-repeat=\"day in week\">\r" +
"\n" +
" <span\r" +
"\n" +
" ng-class=\"classes[$index2][$index]\"\r" +
"\n" +
" ng-click=\"selectDate(day)\" ng-bind=\"day|mFormat:'DD':tz\"></span>\r" +
"\n" +
" </td>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </tbody>\r" +
"\n" +
" </table>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-switch-when=\"year\">\r" +
"\n" +
" <table>\r" +
"\n" +
" <thead>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-click=\"prev(10)\">&lsaquo;</th>\r" +
"\n" +
" <th colspan=\"5\" class=\"switch\"ng-bind=\"years[0].year()+' - '+years[years.length-1].year()\"></th>\r" +
"\n" +
" <th ng-click=\"next(10)\">&rsaquo;</i></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </thead>\r" +
"\n" +
" <tbody>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <td colspan=\"7\">\r" +
"\n" +
" <span ng-class=\"classes[$index]\"\r" +
"\n" +
" ng-repeat=\"year in years\"\r" +
"\n" +
" ng-click=\"selectDate(year)\" ng-bind=\"year.year()\"></span>\r" +
"\n" +
" </td>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </tbody>\r" +
"\n" +
" </table>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-switch-when=\"month\">\r" +
"\n" +
" <table>\r" +
"\n" +
" <thead>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\r" +
"\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('year')\" ng-bind=\"date|mFormat:'YYYY':tz\"></th>\r" +
"\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </thead>\r" +
"\n" +
" <tbody>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <td colspan=\"7\">\r" +
"\n" +
" <span ng-repeat=\"month in months\"\r" +
"\n" +
" ng-class=\"classes[$index]\"\r" +
"\n" +
" ng-click=\"selectDate(month)\"\r" +
"\n" +
" ng-bind=\"month|mFormat:'MMM':tz\"></span>\r" +
"\n" +
" </td>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </tbody>\r" +
"\n" +
" </table>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-switch-when=\"hours\">\r" +
"\n" +
" <table>\r" +
"\n" +
" <thead>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-click=\"prev(24)\">&lsaquo;</th>\r" +
"\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('date')\" ng-bind=\"date|mFormat:'DD MMMM YYYY':tz\"></th>\r" +
"\n" +
" <th ng-click=\"next(24)\">&rsaquo;</i></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </thead>\r" +
"\n" +
" <tbody>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <td colspan=\"7\">\r" +
"\n" +
" <span ng-repeat=\"hour in hours\"\r" +
"\n" +
" ng-class=\"classes[$index]\"\r" +
"\n" +
" ng-click=\"selectDate(hour)\" ng-bind=\"hour|mFormat:'HH:mm':tz\"></span>\r" +
"\n" +
" </td>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </tbody>\r" +
"\n" +
" </table>\r" +
"\n" +
" </div>\r" +
"\n" +
" <div ng-switch-when=\"minutes\">\r" +
"\n" +
" <table>\r" +
"\n" +
" <thead>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\r" +
"\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('hours')\" ng-bind=\"date|mFormat:'DD MMMM YYYY':tz\"></th>\r" +
"\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </thead>\r" +
"\n" +
" <tbody>\r" +
"\n" +
" <tr>\r" +
"\n" +
" <td colspan=\"7\">\r" +
"\n" +
" <span ng-repeat=\"minute in minutes\"\r" +
"\n" +
" ng-class=\"classes[$index]\"\r" +
"\n" +
" ng-click=\"selectDate(minute)\"\r" +
"\n" +
" ng-bind=\"minute|mFormat:'HH:mm':tz\"></span>\r" +
"\n" +
" </td>\r" +
"\n" +
" </tr>\r" +
"\n" +
" </tbody>\r" +
"\n" +
" </table>\r" +
"\n" +
" </div>\r" +
"\n" +
"</div>"
"<div ng-switch=\"view\" data-current-view=\"{{view}}\">\n" +
" <div ng-switch-when=\"date\">\n" +
" <table>\n" +
" <thead>\n" +
" <tr>\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('month')\" ng-bind=\"date|mFormat:'YYYY MMMM':tz\"></th>\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\n" +
" </tr>\n" +
" <tr>\n" +
" <th ng-repeat=\"day in weekdays\" style=\"overflow: hidden\" ng-bind=\"day|mFormat:'ddd':tz\"></th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr ng-repeat=\"week in weeks\" ng-init=\"$index2 = $index\">\n" +
" <td ng-repeat=\"day in week\">\n" +
" <span\n" +
" ng-class=\"classes[$index2][$index]\"\n" +
" ng-click=\"selectDate(day)\" ng-bind=\"day|mFormat:'DD':tz\"></span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" <div ng-switch-when=\"year\">\n" +
" <table>\n" +
" <thead>\n" +
" <tr>\n" +
" <th ng-click=\"prev(10)\">&lsaquo;</th>\n" +
" <th colspan=\"5\" class=\"switch\"ng-bind=\"years[0].year()+' - '+years[years.length-1].year()\"></th>\n" +
" <th ng-click=\"next(10)\">&rsaquo;</i></th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr>\n" +
" <td colspan=\"7\">\n" +
" <span ng-class=\"classes[$index]\"\n" +
" ng-repeat=\"year in years\"\n" +
" ng-click=\"selectDate(year)\" ng-bind=\"year.year()\"></span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" <div ng-switch-when=\"month\">\n" +
" <table>\n" +
" <thead>\n" +
" <tr>\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('year')\" ng-bind=\"date|mFormat:'YYYY':tz\"></th>\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr>\n" +
" <td colspan=\"7\">\n" +
" <span ng-repeat=\"month in months\"\n" +
" ng-class=\"classes[$index]\"\n" +
" ng-click=\"selectDate(month)\"\n" +
" ng-bind=\"month|mFormat:'MMM':tz\"></span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" <div ng-switch-when=\"hours\">\n" +
" <table>\n" +
" <thead>\n" +
" <tr>\n" +
" <th ng-click=\"prev(24)\">&lsaquo;</th>\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('date')\" ng-bind=\"date|mFormat:'DD MMMM YYYY':tz\"></th>\n" +
" <th ng-click=\"next(24)\">&rsaquo;</i></th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr>\n" +
" <td colspan=\"7\">\n" +
" <span ng-repeat=\"hour in hours\"\n" +
" ng-class=\"classes[$index]\"\n" +
" ng-click=\"selectDate(hour)\" ng-bind=\"hour|mFormat:'HH:mm':tz\"></span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
" <div ng-switch-when=\"minutes\">\n" +
" <table>\n" +
" <thead>\n" +
" <tr>\n" +
" <th ng-click=\"prev()\">&lsaquo;</th>\n" +
" <th colspan=\"5\" class=\"switch\" ng-click=\"setView('hours')\" ng-bind=\"date|mFormat:'DD MMMM YYYY':tz\"></th>\n" +
" <th ng-click=\"next()\">&rsaquo;</i></th>\n" +
" </tr>\n" +
" </thead>\n" +
" <tbody>\n" +
" <tr>\n" +
" <td colspan=\"7\">\n" +
" <span ng-repeat=\"minute in minutes\"\n" +
" ng-class=\"classes[$index]\"\n" +
" ng-click=\"selectDate(minute)\"\n" +
" ng-bind=\"minute|mFormat:'HH:mm':tz\"></span>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </div>\n" +
"</div>\n"
);
}]);
})(angular);
}));

@@ -1,1 +0,1 @@

"use strict";!function(a){var b=a.module("datePicker",[]);b.constant("datePickerConfig",{template:"templates/datepicker.html",view:"month",views:["year","month","date","hours","minutes"],momentNames:{year:"year",month:"month",date:"day",hours:"hours",minutes:"minutes"},viewConfig:{year:["years","isSameYear"],month:["months","isSameMonth"],hours:["hours","isSameHour"],minutes:["minutes","isSameMinutes"]},step:5,firstDay:0}),b.filter("mFormat",function(){return function(a,b,c){return moment.isMoment(a)?c?moment.tz(a,c).format(b):a.format(b):moment(a).format(b)}}),b.directive("datePicker",["datePickerConfig","datePickerUtils",function(b,c){return{require:"?ngModel",template:'<div ng-include="template"></div>',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(d,e,f,g){function h(){d.views=b.views.concat(),d.view=f.view||b.view,d.views=d.views.slice(d.views.indexOf(f.maxView||"year"),d.views.indexOf(f.minView||"minutes")+1),(1===d.views.length||-1===d.views.indexOf(d.view))&&(d.view=d.views[0])}function i(a){return c.getDate(d,f,a)}function j(a){a&&(d.model=a,g&&g.$setViewValue(a)),d.$emit("setDate",d.model,d.view),d.callbackOnSetDate&&d.callbackOnSetDate(f.datePicker,d.date)}function k(){var a=d.view;c.setParams(s,D),d.model&&!r&&(d.date=t(d.model),r=!1);var b=d.date;switch(a){case"year":d.years=c.getVisibleYears(b);break;case"month":d.months=c.getVisibleMonths(b);break;case"date":d.weekdays=d.weekdays||c.getDaysOfWeek(),d.weeks=c.getVisibleWeeks(b);break;case"hours":d.hours=c.getVisibleHours(b);break;case"minutes":d.minutes=c.getVisibleMinutes(b,v)}m()}function l(){return"date"!==d.view?d.view:d.date?d.date.month():null}function m(){var a,e,f=d.view,g=d.date,h=[],i="";if(c.setParams(s,D),"date"===f){var j,k=d.weeks;for(a=0;a<k.length;a++)for(j=k[a],h.push([]),e=0;e<j.length;e++)i="",c.isSameDay(g,j[e])&&(i+="active"),q(j[e],f)&&(i+=" now"),j[e].month()===g.month()&&n(j[e])||(i+=" disabled"),h[a].push(i)}else{var l=b.viewConfig[f],m=d[l[0]],o=l[1];for(a=0;a<m.length;a++)i="",c[o](g,m[a])&&(i+="active"),q(m[a],f)&&(i+=" now"),n(m[a])||(i+=" disabled"),h.push(i)}d.classes=h}function n(a){var b=!0;return x&&x.isAfter(a)&&(b=o(x,a)),y&&y.isBefore(a)&&(b&=o(y,a)),b}function o(a,c){return a.isSame(c,b.momentNames[d.view])?!0:!1}function p(a){return x&&x.isAfter(a)?x:y&&y.isBefore(a)?y:a}function q(a,b){var c=!0;switch(b){case"minutes":c&=~~(A.minutes()/v)===~~(a.minutes()/v);case"hours":c&=A.hours()===a.hours();case"date":c&=A.date()===a.date();case"month":c&=A.month()===a.month();case"year":c&=A.year()===a.year()}return c}var r=!1,s=d.tz=f.timezone,t=c.createMoment,u=c.eventIsForPicker,v=parseInt(f.step||b.step,10),w=!!f.partial,x=i("minDate"),y=i("maxDate"),z=e[0].id,A=d.now=t(),B=d.date=t(d.model||A),C="true"===f.autoClose,D=f.firstDay&&f.firstDay>=0&&f.firstDay<=6?parseInt(f.firstDay,10):b.firstDay;c.setParams(s,D),d.model||B.minute(Math.ceil(B.minute()/v)*v).second(0),d.template=f.template||b.template,d.watchDirectChanges=void 0!==f.watchDirectChanges,d.callbackOnSetDate=f.dateChange?c.findFunction(d,f.dateChange):void 0,h(),d.setView=function(a){-1!==d.views.indexOf(a)&&(d.view=a)},d.selectDate=function(a){if(f.disabled)return!1;if(o(d.date,a)&&(a=d.date),a=p(a),!a)return!1;d.date=a;var b=d.views[d.views.indexOf(d.view)+1];(!b||w||d.model)&&j(a),b?d.setView(b):C?(e.addClass("hidden"),d.$emit("hidePicker")):m()},d.$watch(l,k),d.watchDirectChanges&&d.$watch("model",function(){r=!1,k()}),d.next=function(a){var b=moment(d.date);switch(a=a||1,d.view){case"year":case"month":b.year(b.year()+a);break;case"date":b.month(b.month()+a);break;case"hours":case"minutes":b.hours(b.hours()+a)}b=p(b),b&&(d.date=b,j(b),r=!0,k())},d.prev=function(a){return d.next(-a||-1)},z&&d.$on("pickerUpdate",function(b,c,d){if(u(c,z)){var e=!1,g=!1;a.isDefined(d.minDate)&&(x=d.minDate?d.minDate:!1,g=!0),a.isDefined(d.maxDate)&&(y=d.maxDate?d.maxDate:!1,g=!0),a.isDefined(d.minView)&&(f.minView=d.minView,e=!0),a.isDefined(d.maxView)&&(f.maxView=d.maxView,e=!0),f.view=d.view||f.view,e&&h(),g&&k()}})}}}]),a.module("datePicker").factory("datePickerUtils",function(){var b,c,d=function(a,c,d,e,f){var g=Date.UTC(0|a,0|c,0|d,0|e,0|f);return b?moment.tz(g,b):moment(g)};return{getVisibleMinutes:function(a,b){var c,e,f=a.year(),g=a.month(),h=a.date(),i=a.hours(),j=a.utcOffset()/60,k=[];for(e=0;60>e;e+=b)c=d(f,g,h,i-j,e),k.push(c);return k},getVisibleWeeks:function(a){a=moment(a);var b=a.year(),d=a.month();a.date(1);var e=a.day();a.date(c-(e+(c>=e?6:-1)));for(var f=[];f.length<6&&!(a.year()===b&&a.month()>d);)f.push(this.getDaysOfWeek(a)),a.add(7,"d");return f},getVisibleYears:function(a){var b=moment(a),c=b.year();b.year(c-c%10),c=b.year();for(var e,f,g=b.utcOffset()/60,h=[],i=0;12>i;i++)e=d(c,0,1,0-g),f=e.utcOffset()/60,f!==g&&(e=d(c,0,1,0-f),g=f),h.push(e),c++;return h},getDaysOfWeek:function(a){a=a?a:b?moment.tz(b).day(c):moment().day(c);for(var e,f,g=a.year(),h=a.month(),i=a.date(),j=[],k=a.utcOffset()/60,l=0;7>l;l++)e=d(g,h,i,0-k,0,!1),f=e.utcOffset()/60,f!==k&&(e=d(g,h,i,0-f,0,!1)),j.push(e),i++;return j},getVisibleMonths:function(a){for(var b,c,e=a.year(),f=a.utcOffset()/60,g=[],h=0;12>h;h++)b=d(e,h,1,0-f,0,!1),c=b.utcOffset()/60,c!==f&&(b=d(e,h,1,0-c,0,!1)),g.push(b);return g},getVisibleHours:function(a){var b,c,e,f=a.year(),g=a.month(),h=a.date(),i=[],j=a.utcOffset()/60;for(b=0;24>b;b++)c=d(f,g,h,b-j,0,!1),e=c.utcOffset()/60,e!==j&&(c=d(f,g,h,b-e,0,!1)),i.push(c);return i},isAfter:function(a,b){return a&&a.unix()>=b.unix()},isBefore:function(a,b){return a.unix()<=b.unix()},isSameYear:function(a,b){return a&&a.year()===b.year()},isSameMonth:function(a,b){return this.isSameYear(a,b)&&a.month()===b.month()},isSameDay:function(a,b){return this.isSameMonth(a,b)&&a.date()===b.date()},isSameHour:function(a,b){return this.isSameDay(a,b)&&a.hours()===b.hours()},isSameMinutes:function(a,b){return this.isSameHour(a,b)&&a.minutes()===b.minutes()},setParams:function(a,d){b=a,c=d},scopeSearch:function(a,b,c){var d,e,f=a,g=b.split("."),h=g.length;do{for(d=f=f.$parent,e=0;h>e;e++){d=d[g[e]]}if(d&&c(d))return d}while(f.$parent);return!1},findFunction:function(b,c){return this.scopeSearch(b,c,function(b){return a.isFunction(b)})},findParam:function(a,b){return this.scopeSearch(a,b,function(){return!0})},createMoment:function(a){return b?moment.tz(a,b):moment.isMoment(a)?moment.unix(a.unix()):moment(a)},getDate:function(a,b,c){var d=!1;return b[c]&&(d=this.createMoment(b[c]),d.isValid()||(d=this.findParam(a,b[c]),d&&(d=this.createMoment(d)))),d},eventIsForPicker:function(b,c){return a.isArray(b)&&b.indexOf(c)>-1||b===c}}});var b=a.module("datePicker");b.directive("dateRange",["$compile","datePickerUtils","dateTimeConfig",function(b,c,d){function e(b,c,e,f,g){return d.template(a.extend(b,{ngModel:e,minDate:f&&moment.isMoment(f)?f.format():!1,maxDate:g&&moment.isMoment(g)?g.format():!1}),c)}function f(){return"picker"+Math.random().toString().substr(2)}return{scope:{start:"=",end:"="},link:function(d,g,h){function i(a){d.$broadcast("pickerUpdate",m[0],{maxDate:a})}function j(a){d.$broadcast("pickerUpdate",m[1],{minDate:a})}var k=null,l=g[0].id,m=[f(),f()],n=c.createMoment,o=c.eventIsForPicker;d.dateChange=function(a,b){k&&k(a,b)},l&&d.$on("pickerUpdate",function(a,b,c){o(b,l)&&d.$broadcast("pickerUpdate",m,c)}),c.setParams(h.timezone),d.start=n(d.start),d.end=n(d.end),d.$watchGroup(["start","end"],function(a){j(a[0]),i(a[1])}),a.isDefined(h.dateChange)&&(k=c.findFunction(d,h.dateChange)),h.onSetDate="dateChange";var p='<div><table class="date-range"><tr><td valign="top">'+e(h,m[0],"start",!1,d.end)+'</td><td valign="top">'+e(h,m[1],"end",d.start,!1)+"</td></tr></table></div>",q=b(p)(d);g.append(q)}}}]);var c="ng-pristine",d="ng-dirty",b=a.module("datePicker");b.constant("dateTimeConfig",{template:function(a,b){return"<div "+(b?'id="'+b+'" ':"")+'date-picker="'+a.ngModel+'" '+(a.view?'view="'+a.view+'" ':"")+(a.maxView?'max-view="'+a.maxView+'" ':"")+(a.maxDate?'max-date="'+a.maxDate+'" ':"")+(a.autoClose?'auto-close="'+a.autoClose+'" ':"")+(a.template?'template="'+a.template+'" ':"")+(a.minView?'min-view="'+a.minView+'" ':"")+(a.minDate?'min-date="'+a.minDate+'" ':"")+(a.partial?'partial="'+a.partial+'" ':"")+(a.step?'step="'+a.step+'" ':"")+(a.onSetDate?'date-change="'+a.onSetDate+'" ':"")+(a.ngModel?'ng-model="'+a.ngModel+'" ':"")+(a.firstDay?'first-day="'+a.firstDay+'" ':"")+(a.timezone?'timezone="'+a.timezone+'" ':"")+'class="date-picker-date-time"></div>'},format:"YYYY-MM-DD HH:mm",views:["date","year","month","hours","minutes"],autoClose:!1,position:"relative"}),b.directive("dateTimeAppend",function(){return{link:function(a,b){b.bind("click",function(){b.find("input")[0].focus()})}}}),b.directive("dateTime",["$compile","$document","$filter","dateTimeConfig","$parse","datePickerUtils",function(b,e,f,g,h,i){var j=e.find("body"),k=f("mFormat");return{require:"ngModel",scope:!0,link:function(e,f,l,m){function n(a){return k(a,w,K)}function o(a){return a.length===w.length?a:void 0}function p(a){G=a,l.minDate=a?a.format():a,H=moment.isMoment(a)}function q(a){I=a,l.maxDate=a?a.format():a,J=moment.isMoment(a)}function r(){v=g.template(l)}function s(a){a.stopPropagation(),m.$pristine&&(m.$dirty=!0,m.$pristine=!1,f.removeClass(c).addClass(d),x&&x.$setDirty(),m.$render())}function t(){C&&(C.remove(),C=null),F&&(F.remove(),F=null)}function u(){if(!C){if(C=b(v)(e),e.$digest(),N||(e.$on("setDate",function(a,b,c){s(a),M&&M(l.ngModel,b),B&&y[y.length-1]===c&&t()}),e.$on("hidePicker",function(){f.triggerHandler("blur")}),e.$on("$destroy",t),N=!0),"absolute"===E){var c=f[0].getBoundingClientRect(),d=c.height||f[0].offsetHeight;C.css({top:c.top+d+"px",left:c.left+"px",display:"block",position:E}),j.append(C)}else F=a.element("<div date-picker-wrapper></div>"),f[0].parentElement.insertBefore(F[0],f[0]),F.append(C),C.css({top:f[0].offsetHeight+"px",display:"block"});C.bind("mousedown",function(a){a.preventDefault()})}}var v,w=l.format||g.format,x=f.inheritedData("$formController"),y=h(l.views)(e)||g.views.concat(),z=l.view||y[0],A=y.indexOf(z),B=l.autoClose?h(l.autoClose)(e):g.autoClose,C=null,D=f[0].id,E=l.position||g.position,F=null,G=null,H=null,I=null,J=null,K=l.timezone||!1,L=i.eventIsForPicker,M=null,N=!1;-1===A&&y.splice(A,1),y.unshift(z),m.$formatters.push(n),m.$parsers.unshift(o),a.isDefined(l.minDate)&&(p(i.findParam(e,l.minDate)),m.$validators.min=function(a){return H?moment.isMoment(a)&&(G.isSame(a)||G.isBefore(a)):!0}),a.isDefined(l.maxDate)&&(q(i.findParam(e,l.maxDate)),m.$validators.max=function(a){return J?moment.isMoment(a)&&(I.isSame(a)||I.isAfter(a)):!0}),a.isDefined(l.dateChange)&&(M=i.findFunction(e,l.dateChange)),D&&e.$on("pickerUpdate",function(b,c,d){if(L(c,D))if(C);else{var e=!1;a.isDefined(d.minDate)&&(p(d.minDate),e=!0),a.isDefined(d.maxDate)&&(q(d.maxDate),e=!0),a.isDefined(d.minView)&&(l.minView=d.minView),a.isDefined(d.maxView)&&(l.maxView=d.maxView),l.view=d.view||l.view,e&&m.$validate(),a.isDefined(d.format)&&(w=l.format=d.format||g.format,m.$modelValue=-1),r()}}),f.bind("focus",u),f.bind("blur",t),r()}}}]),a.module("datePicker").run(["$templateCache",function(a){a.put("templates/datepicker.html",'<div ng-switch="view">\r\n <div ng-switch-when="date">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th ng-click="prev()">&lsaquo;</th>\r\n <th colspan="5" class="switch" ng-click="setView(\'month\')" ng-bind="date|mFormat:\'YYYY MMMM\':tz"></th>\r\n <th ng-click="next()">&rsaquo;</i></th>\r\n </tr>\r\n <tr>\r\n <th ng-repeat="day in weekdays" style="overflow: hidden" ng-bind="day|mFormat:\'ddd\':tz"></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr ng-repeat="week in weeks" ng-init="$index2 = $index">\r\n <td ng-repeat="day in week">\r\n <span\r\n ng-class="classes[$index2][$index]"\r\n ng-click="selectDate(day)" ng-bind="day|mFormat:\'DD\':tz"></span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div ng-switch-when="year">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th ng-click="prev(10)">&lsaquo;</th>\r\n <th colspan="5" class="switch"ng-bind="years[0].year()+\' - \'+years[years.length-1].year()"></th>\r\n <th ng-click="next(10)">&rsaquo;</i></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <td colspan="7">\r\n <span ng-class="classes[$index]"\r\n ng-repeat="year in years"\r\n ng-click="selectDate(year)" ng-bind="year.year()"></span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div ng-switch-when="month">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th ng-click="prev()">&lsaquo;</th>\r\n <th colspan="5" class="switch" ng-click="setView(\'year\')" ng-bind="date|mFormat:\'YYYY\':tz"></th>\r\n <th ng-click="next()">&rsaquo;</i></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <td colspan="7">\r\n <span ng-repeat="month in months"\r\n ng-class="classes[$index]"\r\n ng-click="selectDate(month)"\r\n ng-bind="month|mFormat:\'MMM\':tz"></span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div ng-switch-when="hours">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th ng-click="prev(24)">&lsaquo;</th>\r\n <th colspan="5" class="switch" ng-click="setView(\'date\')" ng-bind="date|mFormat:\'DD MMMM YYYY\':tz"></th>\r\n <th ng-click="next(24)">&rsaquo;</i></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <td colspan="7">\r\n <span ng-repeat="hour in hours"\r\n ng-class="classes[$index]"\r\n ng-click="selectDate(hour)" ng-bind="hour|mFormat:\'HH:mm\':tz"></span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div ng-switch-when="minutes">\r\n <table>\r\n <thead>\r\n <tr>\r\n <th ng-click="prev()">&lsaquo;</th>\r\n <th colspan="5" class="switch" ng-click="setView(\'hours\')" ng-bind="date|mFormat:\'DD MMMM YYYY\':tz"></th>\r\n <th ng-click="next()">&rsaquo;</i></th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <td colspan="7">\r\n <span ng-repeat="minute in minutes"\r\n ng-class="classes[$index]"\r\n ng-click="selectDate(minute)"\r\n ng-bind="minute|mFormat:\'HH:mm\':tz"></span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n</div>')}])}(angular);
!function(a,b){"use strict";"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("angular"),require("moment")):"function"==typeof define&&define.amd?define(["angular","moment"],b):b(a.angular,a.moment)}(this,function(a,b){var c=a.module("datePicker",[]);c.constant("datePickerConfig",{template:"templates/datepicker.html",view:"month",views:["year","month","date","hours","minutes"],momentNames:{year:"year",month:"month",date:"day",hours:"hours",minutes:"minutes"},viewConfig:{year:["years","isSameYear"],month:["months","isSameMonth"],hours:["hours","isSameHour"],minutes:["minutes","isSameMinutes"]},step:5}),c.filter("mFormat",function(){return function(a,c,d){return b.isMoment(a)?d?b.tz(a,d).format(c):a.format(c):b(a).format(c)}}),c.directive("datePicker",["datePickerConfig","datePickerUtils",function(c,d){return{require:"?ngModel",template:'<div ng-include="template"></div>',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(e,f,g,h){function i(){e.views=c.views.concat(),e.view=g.view||c.view,e.views=e.views.slice(e.views.indexOf(g.maxView||"year"),e.views.indexOf(g.minView||"minutes")+1),1!==e.views.length&&-1!==e.views.indexOf(e.view)||(e.view=e.views[0])}function j(a){return d.getDate(e,g,a)}function k(){var a=e.view;d.setParams(t,E),e.model&&!s&&(e.date=u(e.model),s=!1);var b=e.date;switch(a){case"year":e.years=d.getVisibleYears(b);break;case"month":e.months=d.getVisibleMonths(b);break;case"date":e.weekdays=e.weekdays||d.getDaysOfWeek(),e.weeks=d.getVisibleWeeks(b);break;case"hours":e.hours=d.getVisibleHours(b);break;case"minutes":e.minutes=d.getVisibleMinutes(b,w)}n()}function l(){return"date"!==e.view?e.view:e.date?e.date.month():null}var m,n,o,p,q,r,s=!1,t=e.tz=g.timezone,u=d.createMoment,v=d.eventIsForPicker,w=parseInt(g.step||c.step,10),x=!!g.partial,y=j("minDate"),z=j("maxDate"),A=f[0].id,B=e.now=u(),C=e.date=u(e.model||B),D="true"===g.autoClose,E=g.firstDay&&g.firstDay>=0&&g.firstDay<=6?parseInt(g.firstDay,10):b().weekday(0).day();d.setParams(t,E),e.model||C.minute(Math.ceil(C.minute()/w)*w).second(0),e.template=g.template||c.template,e.watchDirectChanges=void 0!==g.watchDirectChanges,e.callbackOnSetDate=g.dateChange?d.findFunction(e,g.dateChange):void 0,i(),e.setView=function(a){-1!==e.views.indexOf(a)&&(e.view=a)},e.selectDate=function(a){if(g.disabled)return!1;if(o(e.date,a)&&(a=e.date),!(a=p(a)))return!1;e.date=a;var b=e.views[e.views.indexOf(e.view)+1];(!b||x||e.model)&&m(a),b?e.setView(b):D?(f.addClass("hidden"),e.$emit("hidePicker")):n()},m=function(a){a&&(e.model=a,h&&h.$setViewValue(a)),e.$emit("setDate",e.model,e.view),e.callbackOnSetDate&&e.callbackOnSetDate(g.datePicker,e.date)},e.$watch(l,k),e.watchDirectChanges&&e.$watch("model",function(){s=!1,k()}),n=function(){var a,b,f=e.view,g=e.date,h=[],i="";if(d.setParams(t,E),"date"===f){var j,k=e.weeks;for(a=0;a<k.length;a++)for(j=k[a],h.push([]),b=0;b<j.length;b++)i="",d.isSameDay(g,j[b])&&(i+="active"),q(j[b],f)&&(i+=" now"),j[b].month()===g.month()&&r(j[b])||(i+=" disabled"),h[a].push(i)}else{var l=c.viewConfig[f],m=e[l[0]],n=l[1];for(a=0;a<m.length;a++)i="",d[n](g,m[a])&&(i+="active"),q(m[a],f)&&(i+=" now"),r(m[a])||(i+=" disabled"),h.push(i)}e.classes=h},e.next=function(a){var c=b(e.date);switch(a=a||1,e.view){case"year":case"month":c.year(c.year()+a);break;case"date":c.month(c.month()+a);break;case"hours":case"minutes":c.hours(c.hours()+a)}(c=p(c))&&(e.date=c,m(c),s=!0,k())},r=function(a){var b=!0;return y&&y.isAfter(a)&&(b=o(y,a)),z&&z.isBefore(a)&&(b&=o(z,a)),b},o=function(a,b){return!!a.isSame(b,c.momentNames[e.view])},p=function(a){return y&&y.isAfter(a)?y:z&&z.isBefore(a)?z:a},q=function(a,b){var c=!0;switch(b){case"minutes":c&=~~(B.minutes()/w)==~~(a.minutes()/w);case"hours":c&=B.hours()===a.hours();case"date":c&=B.date()===a.date();case"month":c&=B.month()===a.month();case"year":c&=B.year()===a.year()}return c},e.prev=function(a){return e.next(-a||-1)},A&&e.$on("pickerUpdate",function(b,c,d){if(v(c,A)){var e=!1,f=!1;a.isDefined(d.minDate)&&(y=!!d.minDate&&d.minDate,f=!0),a.isDefined(d.maxDate)&&(z=!!d.maxDate&&d.maxDate,f=!0),a.isDefined(d.minView)&&(g.minView=d.minView,e=!0),a.isDefined(d.maxView)&&(g.maxView=d.maxView,e=!0),g.view=d.view||g.view,e&&i(),f&&k()}})}}}]),a.module("datePicker").factory("datePickerUtils",function(){var c,d,e=function(a,d,e,f,g){var h=Date.UTC(0|a,0|d,0|e,0|f,0|g);return c?b.tz(h,c):b(h)};return{getVisibleMinutes:function(a,b){var c,d,f=a.year(),g=a.month(),h=a.date(),i=a.hours(),j=a.utcOffset()/60,k=[];for(d=0;d<60;d+=b)c=e(f,g,h,i-j,d),k.push(c);return k},getVisibleWeeks:function(a){a=b(a);var c=a.year(),e=a.month();a.date(1);var f=a.day();a.date(d-(f+(d>=f?6:-1)));for(var g=[];g.length<6&&!(a.year()===c&&a.month()>e);)g.push(this.getDaysOfWeek(a)),a.add(7,"d");return g},getVisibleYears:function(a){var c=b(a),d=c.year();c.year(d-d%10),d=c.year();for(var f,g,h=c.utcOffset()/60,i=[],j=0;j<12;j++)f=e(d,0,1,0-h),g=f.utcOffset()/60,g!==h&&(f=e(d,0,1,0-g),h=g),i.push(f),d++;return i},getDaysOfWeek:function(a){a=a||(c?b.tz(c).day(d):b().day(d));for(var f,g,h=a.year(),i=a.month(),j=a.date(),k=[],l=a.utcOffset()/60,m=0;m<7;m++)f=e(h,i,j,0-l,0,!1),g=f.utcOffset()/60,g!==l&&(f=e(h,i,j,0-g,0,!1)),k.push(f),j++;return k},getVisibleMonths:function(a){for(var b,c,d=a.year(),f=a.utcOffset()/60,g=[],h=0;h<12;h++)b=e(d,h,1,0-f,0,!1),c=b.utcOffset()/60,c!==f&&(b=e(d,h,1,0-c,0,!1)),g.push(b);return g},getVisibleHours:function(a){var b,c,d,f=a.year(),g=a.month(),h=a.date(),i=[],j=a.utcOffset()/60;for(b=0;b<24;b++)c=e(f,g,h,b-j,0,!1),d=c.utcOffset()/60,d!==j&&(c=e(f,g,h,b-d,0,!1)),i.push(c);return i},isAfter:function(a,b){return a&&a.unix()>=b.unix()},isBefore:function(a,b){return a.unix()<=b.unix()},isSameYear:function(a,b){return a&&a.year()===b.year()},isSameMonth:function(a,b){return this.isSameYear(a,b)&&a.month()===b.month()},isSameDay:function(a,b){return this.isSameMonth(a,b)&&a.date()===b.date()},isSameHour:function(a,b){return this.isSameDay(a,b)&&a.hours()===b.hours()},isSameMinutes:function(a,b){return this.isSameHour(a,b)&&a.minutes()===b.minutes()},setParams:function(a,b){c=a,d=b},scopeSearch:function(a,b,c){var d,e,f=a,g=b.split("."),h=g.length;do{for(d=f=f.$parent,e=0;e<h;e++){d=d[g[e]]}if(d&&c(d))return d}while(f.$parent);return!1},findFunction:function(b,c){return this.scopeSearch(b,c,function(b){return a.isFunction(b)})},findParam:function(a,b){return this.scopeSearch(a,b,function(){return!0})},createMoment:function(a){return c?b.tz(a,c):b.isMoment(a)?b.unix(a.unix()):b(a)},getDate:function(a,b,c){var d=!1;return b[c]&&(d=this.createMoment(b[c]),d.isValid()||(d=this.findParam(a,b[c]))&&(d=this.createMoment(d))),d},eventIsForPicker:function(b,c){function d(a){return a instanceof RegExp?a.test(c):a===c}return a.isArray(b)?b.some(d):d(b)}}});var c=a.module("datePicker");c.directive("dateRange",["$compile","datePickerUtils","dateTimeConfig",function(c,d,e){function f(c,d,f,g,h){return e.template(a.extend(c,{ngModel:f,minDate:!(!g||!b.isMoment(g))&&g.format(),maxDate:!(!h||!b.isMoment(h))&&h.format()}),d)}function g(){return"picker"+Math.random().toString().substr(2)}return{scope:{start:"=",end:"="},link:function(b,e,h){function i(a){b.$broadcast("pickerUpdate",m[0],{maxDate:a})}function j(a){b.$broadcast("pickerUpdate",m[1],{minDate:a})}var k=null,l=e[0].id,m=[g(),g()],n=d.createMoment,o=d.eventIsForPicker;b.dateChange=function(a,b){k&&k(a,b)},l&&b.$on("pickerUpdate",function(a,c,d){o(c,l)&&b.$broadcast("pickerUpdate",m,d)}),d.setParams(h.timezone),b.start=n(b.start),b.end=n(b.end),b.$watchGroup(["start","end"],function(a){j(a[0]),i(a[1])}),a.isDefined(h.dateChange)&&(k=d.findFunction(b,h.dateChange)),h.onSetDate="dateChange";var p='<div><table class="date-range"><tr><td valign="top">'+f(h,m[0],"start",!1,b.end)+'</td><td valign="top">'+f(h,m[1],"end",b.start,!1)+"</td></tr></table></div>",q=c(p)(b);e.append(q)}}}]);var c=a.module("datePicker");c.constant("dateTimeConfig",{template:function(a,b){return"<div "+(b?'id="'+b+'" ':"")+'date-picker="'+a.ngModel+'" '+(a.view?'view="'+a.view+'" ':"")+(a.maxView?'max-view="'+a.maxView+'" ':"")+(a.maxDate?'max-date="'+a.maxDate+'" ':"")+(a.autoClose?'auto-close="'+a.autoClose+'" ':"")+(a.template?'template="'+a.template+'" ':"")+(a.minView?'min-view="'+a.minView+'" ':"")+(a.minDate?'min-date="'+a.minDate+'" ':"")+(a.partial?'partial="'+a.partial+'" ':"")+(a.step?'step="'+a.step+'" ':"")+(a.onSetDate?'date-change="'+a.onSetDate+'" ':"")+(a.ngModel?'ng-model="'+a.ngModel+'" ':"")+(a.firstDay?'first-day="'+a.firstDay+'" ':"")+(a.timezone?'timezone="'+a.timezone+'" ':"")+'class="date-picker-date-time"></div>'},format:"YYYY-MM-DD HH:mm",views:["date","year","month","hours","minutes"],autoClose:!1,position:"relative"}),c.directive("dateTimeAppend",function(){return{link:function(a,b){b.bind("click",function(){b.find("input")[0].focus()})}}}),c.directive("dateTime",["$compile","$document","$filter","dateTimeConfig","$parse","datePickerUtils",function(c,d,e,f,g,h){var i=d.find("body"),j=e("mFormat");return{require:"ngModel",scope:!0,link:function(d,e,k,l){function m(a){return j(a,v,J)}function n(a){var c=b(a,v);if(c.isValid())return c}function o(a){F=a,k.minDate=a?a.format():a,G=b.isMoment(a)}function p(a){H=a,k.maxDate=a?a.format():a,I=b.isMoment(a)}function q(){u=f.template(k)}function r(a){a.stopPropagation(),l.$pristine&&(l.$dirty=!0,l.$pristine=!1,e.removeClass("ng-pristine").addClass("ng-dirty"),w&&w.$setDirty(),l.$render())}function s(){B&&(B.remove(),B=null),E&&(E.remove(),E=null)}function t(){if(!B){if(B=c(u)(d),d.$digest(),M||(d.$on("setDate",function(a,b,c){r(a),L&&L(k.ngModel,b),A&&x[x.length-1]===c&&s()}),d.$on("hidePicker",function(){e.triggerHandler("blur")}),d.$on("$destroy",s),M=!0),"absolute"===D){var b=e[0].getBoundingClientRect(),f=b.height||e[0].offsetHeight;B.css({top:b.top+f+"px",left:b.left+"px",display:"block",position:D}),i.append(B)}else E=a.element("<div date-picker-wrapper></div>"),e[0].parentElement.insertBefore(E[0],e[0]),E.append(B),B.css({top:e[0].offsetHeight+"px",display:"block"});B.bind("mousedown",function(a){a.preventDefault()})}}var u,v=k.format||f.format,w=e.inheritedData("$formController"),x=g(k.views)(d)||f.views.concat(),y=k.view||x[0],z=x.indexOf(y),A=k.autoClose?g(k.autoClose)(d):f.autoClose,B=null,C=e[0].id,D=k.position||f.position,E=null,F=null,G=null,H=null,I=null,J=k.timezone||!1,K=h.eventIsForPicker,L=null,M=!1;-1===z&&x.splice(z,1),x.unshift(y),l.$formatters.push(m),l.$parsers.unshift(n),a.isDefined(k.minDate)&&(o(h.findParam(d,k.minDate)),l.$validators.min=function(a){return!G||b.isMoment(a)&&(F.isSame(a)||F.isBefore(a))}),a.isDefined(k.maxDate)&&(p(h.findParam(d,k.maxDate)),l.$validators.max=function(a){return!I||b.isMoment(a)&&(H.isSame(a)||H.isAfter(a))}),a.isDefined(k.dateChange)&&(L=h.findFunction(d,k.dateChange)),C&&d.$on("pickerUpdate",function(b,c,d){if(K(c,C))if(B);else{var e=!1;a.isDefined(d.minDate)&&(o(d.minDate),e=!0),a.isDefined(d.maxDate)&&(p(d.maxDate),e=!0),a.isDefined(d.minView)&&(k.minView=d.minView),a.isDefined(d.maxView)&&(k.maxView=d.maxView),k.view=d.view||k.view,e&&l.$validate(),a.isDefined(d.format)&&(v=k.format=d.format||f.format,l.$modelValue=-1),q()}}),e.bind("focus",t),e.bind("blur",s),q()}}}]),a.module("datePicker").run(["$templateCache",function(a){a.put("templates/datepicker.html",'<div ng-switch="view" data-current-view="{{view}}">\n <div ng-switch-when="date">\n <table>\n <thead>\n <tr>\n <th ng-click="prev()">&lsaquo;</th>\n <th colspan="5" class="switch" ng-click="setView(\'month\')" ng-bind="date|mFormat:\'YYYY MMMM\':tz"></th>\n <th ng-click="next()">&rsaquo;</i></th>\n </tr>\n <tr>\n <th ng-repeat="day in weekdays" style="overflow: hidden" ng-bind="day|mFormat:\'ddd\':tz"></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="week in weeks" ng-init="$index2 = $index">\n <td ng-repeat="day in week">\n <span\n ng-class="classes[$index2][$index]"\n ng-click="selectDate(day)" ng-bind="day|mFormat:\'DD\':tz"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div ng-switch-when="year">\n <table>\n <thead>\n <tr>\n <th ng-click="prev(10)">&lsaquo;</th>\n <th colspan="5" class="switch"ng-bind="years[0].year()+\' - \'+years[years.length-1].year()"></th>\n <th ng-click="next(10)">&rsaquo;</i></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td colspan="7">\n <span ng-class="classes[$index]"\n ng-repeat="year in years"\n ng-click="selectDate(year)" ng-bind="year.year()"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div ng-switch-when="month">\n <table>\n <thead>\n <tr>\n <th ng-click="prev()">&lsaquo;</th>\n <th colspan="5" class="switch" ng-click="setView(\'year\')" ng-bind="date|mFormat:\'YYYY\':tz"></th>\n <th ng-click="next()">&rsaquo;</i></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td colspan="7">\n <span ng-repeat="month in months"\n ng-class="classes[$index]"\n ng-click="selectDate(month)"\n ng-bind="month|mFormat:\'MMM\':tz"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div ng-switch-when="hours">\n <table>\n <thead>\n <tr>\n <th ng-click="prev(24)">&lsaquo;</th>\n <th colspan="5" class="switch" ng-click="setView(\'date\')" ng-bind="date|mFormat:\'DD MMMM YYYY\':tz"></th>\n <th ng-click="next(24)">&rsaquo;</i></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td colspan="7">\n <span ng-repeat="hour in hours"\n ng-class="classes[$index]"\n ng-click="selectDate(hour)" ng-bind="hour|mFormat:\'HH:mm\':tz"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div ng-switch-when="minutes">\n <table>\n <thead>\n <tr>\n <th ng-click="prev()">&lsaquo;</th>\n <th colspan="5" class="switch" ng-click="setView(\'hours\')" ng-bind="date|mFormat:\'DD MMMM YYYY\':tz"></th>\n <th ng-click="next()">&rsaquo;</i></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td colspan="7">\n <span ng-repeat="minute in minutes"\n ng-class="classes[$index]"\n ng-click="selectDate(minute)"\n ng-bind="minute|mFormat:\'HH:mm\':tz"></span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n')}])});

@@ -194,4 +194,4 @@ 'use strict';

options: {
banner:'\'use strict\';\n(function(angular){\n',
footer:'})(angular);',
banner:'\(function (global, factory) {\'use strict\';var fnc;fnc = (typeof exports === \'object\' && typeof module !== \'undefined\') ? module.exports = factory(require(\'angular\'), require(\'moment\')) :(typeof define === \'function\' && define.amd) ? define([\'angular\', \'moment\'], factory) :factory(global.angular, global.moment);}(this, function (angular, moment) {\n',
footer:'}));',
// Replace all 'use strict' statements in the code with a single one at the top

@@ -198,0 +198,0 @@ process: function(src) {

@@ -7,3 +7,13 @@ module.exports = function (config) {

// list of files / patterns to load in the browser
files: ['app/components/angular/angular.js', 'app/components/angular-mocks/angular-mocks.js', 'app/components/moment/moment.js', 'app/components/moment-timezone/builds/moment-timezone-with-data.js', 'app/scripts/*.js', 'app/scripts/**/*.js', 'test/mock/**/*.js', 'test/spec/**/*.js'],
files: [
'app/components/angular/angular.js',
'app/components/angular-mocks/angular-mocks.js',
'app/components/moment/moment.js',
'app/components/moment-timezone/builds/moment-timezone-with-data.js',
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js',
'app/templates/**/*.html'
],

@@ -16,3 +26,3 @@ // list of files to exclude

preprocessors : {
'**/*.html': ['ng-html2js']
},

@@ -54,11 +64,23 @@

plugins : [ 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-script-launcher', 'karma-phantomjs-launcher', 'karma-jasmine' ],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-script-launcher',
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-ng-html2js-preprocessor'
],
// If browser does not capture in given timeout [ms], kill it
captureTimeout : 5000,
captureTimeout : 15000,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun : false
singleRun : false,
ngHtml2JsPreprocessor: {
// strip this from the file path
stripPrefix: 'app/'
}
});
};
{
"name": "front-angular-datepicker",
"version": "2.0.4",
"version": "2.1.3-2",
"main": "dist/angular-datepicker.js",

@@ -35,2 +35,3 @@ "repository": {

"karma-jasmine": "^0.3.5",
"karma-ng-html2js-preprocessor": "^0.2.1",
"karma-phantomjs-launcher": "0.2.0",

@@ -37,0 +38,0 @@ "karma-script-launcher": "^0.1.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc