Skip to content

Commit

Permalink
minutesFormat now uses the last locale preference
Browse files Browse the repository at this point in the history
Closes #40
  • Loading branch information
indrimuska committed Jun 24, 2016
1 parent f0575ff commit 7f4fce2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-moment-picker",
"version": "0.5.5",
"version": "0.5.6",
"authors": [
"Indri Muska <[email protected]>"
],
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-moment-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
monthsFormat: 'MMM',
daysFormat: 'D',
hoursFormat: 'HH:[00]',
minutesFormat: moment.localeData().longDateFormat('LT').replace(/[aA]/, ''),
secondsFormat: 'ss',
minutesStep: 5,
secondsStep: 1
Expand Down Expand Up @@ -405,7 +404,8 @@
minutes: [],
render: function () {
var i = 0,
minute = $scope.view.moment.clone().startOf('hour');
minute = $scope.view.moment.clone().startOf('hour'),
minutesFormat = momentPicker.minutesFormat || moment.localeData($scope.locale).longDateFormat('LT').replace(/[aA]/, '');

$scope.hourView.minutes = [];
for (var m = 0; m < 60; m += momentPicker.minutesStep) {
Expand All @@ -415,7 +415,7 @@
if (!$scope.hourView.minutes[index])
$scope.hourView.minutes[index] = [];
$scope.hourView.minutes[index].push({
label: minute.format(momentPicker.minutesFormat),
label: minute.format(minutesFormat),
year: minute.year(),
month: minute.month(),
date: minute.date(),
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-moment-picker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-moment-picker",
"version": "0.5.5",
"version": "0.5.6",
"description": "Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js",
"main": "dist/angular-moment-picker.js",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/angular-moment-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
monthsFormat: 'MMM',
daysFormat: 'D',
hoursFormat: 'HH:[00]',
minutesFormat: moment.localeData().longDateFormat('LT').replace(/[aA]/, ''),
secondsFormat: 'ss',
minutesStep: 5,
secondsStep: 1
Expand Down Expand Up @@ -405,7 +404,8 @@
minutes: [],
render: function () {
var i = 0,
minute = $scope.view.moment.clone().startOf('hour');
minute = $scope.view.moment.clone().startOf('hour'),
minutesFormat = momentPicker.minutesFormat || moment.localeData($scope.locale).longDateFormat('LT').replace(/[aA]/, '');

$scope.hourView.minutes = [];
for (var m = 0; m < 60; m += momentPicker.minutesStep) {
Expand All @@ -415,7 +415,7 @@
if (!$scope.hourView.minutes[index])
$scope.hourView.minutes[index] = [];
$scope.hourView.minutes[index].push({
label: minute.format(momentPicker.minutesFormat),
label: minute.format(minutesFormat),
year: minute.year(),
month: minute.month(),
date: minute.date(),
Expand Down

0 comments on commit 7f4fce2

Please sign in to comment.