Skip to content

Commit 4445864

Browse files
committed
Name anonymous functions
1 parent d5d4d99 commit 4445864

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/js/datetimepicker.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
2020
minView: 'minute',
2121
startView: 'day'
2222
})
23-
.directive('datetimepicker', ['$log', 'dateTimePickerConfig', function ($log, defaultConfig) {
23+
.directive('datetimepicker', ['$log', 'dateTimePickerConfig', function datetimepickerDirective($log, defaultConfig) {
2424
'use strict';
2525

2626
function DateObject() {
@@ -40,7 +40,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
4040
}
4141
}
4242

43-
var validateConfiguration = function (configuration) {
43+
var validateConfiguration = function validateConfiguration(configuration) {
4444
var validOptions = ['startView', 'minView', 'minuteStep', 'dropdownSelector'];
4545

4646
for (var prop in configuration) {
@@ -122,7 +122,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
122122
beforeRender: '&'
123123
},
124124
replace: true,
125-
link: function (scope, element, attrs, ngModelController) {
125+
link: function link(scope, element, attrs, ngModelController) {
126126

127127
var directiveConfig = {};
128128

@@ -136,13 +136,13 @@ angular.module('ui.bootstrap.datetimepicker', [])
136136

137137
validateConfiguration(configuration);
138138

139-
var startOfDecade = function (unixDate) {
139+
var startOfDecade = function startOfDecade(unixDate) {
140140
var startYear = (parseInt(moment.utc(unixDate).year() / 10, 10) * 10);
141141
return moment.utc(unixDate).year(startYear).startOf('year');
142142
};
143143

144144
var dataFactory = {
145-
year: function (unixDate) {
145+
year: function year(unixDate) {
146146
var selectedDate = moment.utc(unixDate).startOf('year');
147147
// View starts one year before the decade starts and ends one year after the decade ends
148148
// i.e. passing in a date of 1/1/2013 will give a range of 2009 to 2020
@@ -177,7 +177,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
177177
return result;
178178
},
179179

180-
month: function (unixDate) {
180+
month: function month(unixDate) {
181181

182182
var startDate = moment.utc(unixDate).startOf('year');
183183
var previousViewDate = startOfDecade(unixDate);
@@ -210,7 +210,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
210210
return result;
211211
},
212212

213-
day: function (unixDate) {
213+
day: function day(unixDate) {
214214

215215
var selectedDate = moment.utc(unixDate);
216216
var startOfMonth = moment.utc(selectedDate).startOf('month');
@@ -259,7 +259,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
259259
return result;
260260
},
261261

262-
hour: function (unixDate) {
262+
hour: function hour(unixDate) {
263263
var selectedDate = moment.utc(unixDate).startOf('day');
264264
var previousViewDate = moment.utc(selectedDate).startOf('month');
265265

@@ -292,7 +292,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
292292
return result;
293293
},
294294

295-
minute: function (unixDate) {
295+
minute: function minute(unixDate) {
296296
var selectedDate = moment.utc(unixDate).startOf('hour');
297297
var previousViewDate = moment.utc(selectedDate).startOf('day');
298298
var activeFormat = ngModelController.$modelValue ? moment(ngModelController.$modelValue).format('YYYY-MM-DD H:mm') : '';
@@ -326,7 +326,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
326326
return result;
327327
},
328328

329-
setTime: function (unixDate) {
329+
setTime: function setTime(unixDate) {
330330
var tempDate = new Date(unixDate);
331331
var newDate = new Date(tempDate.getTime() + (tempDate.getTimezoneOffset() * 60000));
332332

@@ -343,12 +343,12 @@ angular.module('ui.bootstrap.datetimepicker', [])
343343
}
344344
};
345345

346-
var getUTCTime = function (modelValue) {
346+
var getUTCTime = function getUTCTime(modelValue) {
347347
var tempDate = (modelValue ? moment(modelValue).toDate() : new Date());
348348
return tempDate.getTime() - (tempDate.getTimezoneOffset() * 60000);
349349
};
350350

351-
scope.changeView = function (viewName, dateObject, event) {
351+
scope.changeView = function changeView(viewName, dateObject, event) {
352352
if (event) {
353353
event.stopPropagation();
354354
event.preventDefault();
@@ -391,7 +391,7 @@ angular.module('ui.bootstrap.datetimepicker', [])
391391
selectable: true
392392
}));
393393

394-
ngModelController.$render = function () {
394+
ngModelController.$render = function $render() {
395395
scope.changeView(scope.data.currentView, new DateObject({dateValue: getUTCTime(ngModelController.$modelValue)}));
396396
};
397397
}

0 commit comments

Comments
 (0)