fm-timepicker
Advanced tools
Comparing version 3.0.0 to 3.0.3
{ | ||
"name": "fm-timepicker", | ||
"description": "FairManager Time Picker Component", | ||
"version": "3.0.0", | ||
"version": "3.0.3", | ||
"homepage": "https://github.com/hartwig-at/fm-timepicker", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -364,3 +364,4 @@ /** | ||
if( moment.tz ) { | ||
time = timeString ? moment.tz( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -389,3 +390,4 @@ scope.reference.tz() ) : moment.invalid(); | ||
if( moment.tz ) { | ||
time = timeString ? moment( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -415,3 +417,4 @@ scope.reference.tz() ) : moment.invalid(); | ||
if( moment.tz ) { | ||
time = timeString ? moment( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -451,5 +454,3 @@ scope.reference.tz() ) : moment.invalid(); | ||
// Use $timeout to give the DOM time to catch up. | ||
$timeout( function() { | ||
scrollSelectedItemIntoView(); | ||
} ); | ||
$timeout( scrollSelectedItemIntoView ); | ||
} | ||
@@ -483,3 +484,3 @@ } | ||
scope.modelPreview = scope.ngModel ? scope.ngModel.clone() : scope.startTime.clone(); | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -503,3 +504,3 @@ } | ||
scope.isOpen = false; | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -525,3 +526,3 @@ }; | ||
if( moment.tz ) { | ||
time = moment( timestamp, scope.reference.tz() ); | ||
time = moment( timestamp ).tz( scope.reference.tz() ); | ||
} else { | ||
@@ -572,3 +573,3 @@ time = moment( timestamp ); | ||
if( moment.tz ) { | ||
newTime = moment( scope.time, | ||
newTime = moment.tz( scope.time, | ||
scope.format, | ||
@@ -624,3 +625,3 @@ scope.reference.tz() ); | ||
} | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
}; | ||
@@ -692,3 +693,3 @@ | ||
scope.select( scope.dropDownOptions[ scope.activeIndex ], scope.activeIndex ); | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -695,0 +696,0 @@ } ); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";try{angular.module("fm.components")}catch(a){angular.module("fm.components",[])}angular.module("fm.components").filter("fmTimeFormat",function(){return function(a,b){return"number"==typeof a&&(a=moment(a)),moment(a).format(b)}}).filter("fmTimeInterval",function(){return function(a,b,c,d){if(!b||!c)return a;b=moment(b),c=moment(c),d=d||moment.duration(30,"minutes");for(var e=b.clone();+c>=+e;e.add(d))a.push(+e);return a}}).controller("fmTimepickerController",["$scope",function(a){if(a.reference=a.reference?moment(a.reference):moment(),a.style=a.style||"dropdown",a.isOpen=a.isOpen||!1,a.format=a.format||"LT",a.startTime=a.startTime||moment(a.reference).startOf("day"),a.endTime=a.endTime||moment(a.reference).endOf("day"),a.interval=a.interval||moment.duration(30,"minutes"),a.largeInterval=a.largeInterval||moment.duration(60,"minutes"),a.strict=a.strict||!1,a.btnClass=a.btnClass||"btn-default",a.strict){var b=a.ngModel.valueOf(),c=a.interval.asMilliseconds();b-=b%c,b+=c,a.ngModel=moment(b)}a.constrainToReference=function(b){return b?(b.isSame(a.reference,"day")||b.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),b):(a.startTime.isSame(a.reference,"day")||a.startTime.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),a.endTime.isSame(a.reference,"day")||a.endTime.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),a.ngModel&&!a.ngModel.isSame(a.reference,"day")&&a.ngModel.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),null)},a.constrainToReference(),a.ensureTimeIsWithinBounds=function(b){return b.isBefore(a.startTime)?moment(a.startTime):b.isAfter(a.endTime)?moment(a.endTime):b},a.ngModel=a.ensureTimeIsWithinBounds(a.ngModel),a.findActiveIndex=function(b){a.activeIndex=0;for(var c=a.startTime.clone();+c<=+a.endTime&&!c.isSame(b);c.add(a.interval),++a.activeIndex)if(c.isAfter(b)){a.strict&&(a.activeIndex=-1),a.activeIndex-=1;break}},a.largestPossibleIndex=Number.MAX_VALUE,a.largeIntervalIndexJump=Number.MAX_VALUE,a.findActiveIndex(a.ngModel),a.$watch("interval",function(b){b.asMilliseconds()<1&&(console.error("[fm-timepicker] Error: Supplied interval length is smaller than 1ms! Reverting to default."),a.interval=moment.duration(30,"minutes"))}),a.$watch("largeInterval",function(b){b.asMilliseconds()<10&&(console.error("[fm-timepicker] Error: Supplied large interval length is smaller than 10ms! Reverting to default."),a.largeInterval=moment.duration(60,"minutes"))}),a.$watchCollection("[interval,largeInterval]",function(b){var c=b[0],d=b[1],e=c.asMilliseconds(),f=d.asMilliseconds();0!==f%e&&(console.warn("[fm-timepicker] Warning: Large interval is not a multiple of interval! Using internally computed value instead."),a.largeInterval=moment.duration(5*e),f=a.largeInterval.asMilliseconds()),a.largeIntervalIndexJump=f/e})}]).directive("fmTimepickerToggle",function(){return{restrict:"A",link:function(a,b){b.bind("click",function(){a.isOpen?(a.focusInputElement(),a.closePopup()):a.focusInputElement()})}}}).directive("fmTimepicker",["$timeout",function(a){return{template:"<div> <div class='input-group'> <span class='input-group-btn' ng-if='style==\"sequential\"'> <button type='button' class='btn {{btnClass}}' ng-click='decrement()' ng-disabled='activeIndex==0'> <span class='glyphicon glyphicon-minus'></span> </button> </span> <input type='text' class='form-control' ng-model='time' ng-keyup='handleKeyboardInput($event)' ng-change='update()'> <span class='input-group-btn'> <button type='button' class='btn {{btnClass}}' ng-if='style==\"sequential\"' ng-click='increment()' ng-disabled='activeIndex==largestPossibleIndex'> <span class='glyphicon glyphicon-plus'></span> </button> <button type='button' class='btn {{btnClass}}' ng-if='style==\"dropdown\"' ng-class='{active:isOpen}' fm-timepicker-toggle> <span class='glyphicon glyphicon-time'></span> </button> </span> </div> <div class='dropdown' ng-if='style==\"dropdown\"' ng-class='{open:isOpen}'> <ul class='dropdown-menu form-control' style='height:auto; max-height:160px; overflow-y:scroll;' ng-mousedown=\"handleListClick($event)\"> <li ng-repeat='time in ( $parent.dropDownOptions = ( [] | fmTimeInterval:startTime:endTime:interval ) )' ng-click='select(time,$index)' ng-class='{active:(activeIndex==$index)}'> {{$last?largestPossibleIndexIs($index):angular.noop()}} <a href='#' ng-click='preventDefault($event)'>{{time|fmTimeFormat:format}}</a> </li> </ul> </div></div>",replace:!0,restrict:"E",scope:{ngModel:"=",format:"=?",startTime:"=?",endTime:"=?",reference:"=?",interval:"=?",largeInterval:"=?",isOpen:"=?",style:"=?",strict:"=?",btnClass:"=?"},controller:"fmTimepickerController",require:"ngModel",link:function(b,c,d,e){function f(a){e.$setValidity("time",a),e.$setValidity("bounds",a),e.$setValidity("interval",a)}function g(){f(!0);var a=h(b.time);if(b.strict&&(a=a&&i(b.time)&&j(b.time)),a){var c;c=moment.tz?moment.tz(b.time,b.format,b.reference.tz()):moment(b.time,b.format),c=b.constrainToReference(c),e.$setViewValue(c),b.time=moment.tz?moment.tz(b.time,b.format,b.reference.tz()).format(b.format):moment(b.time,b.format).format(b.format)}}function h(a){var c;return c=moment.tz?a?moment.tz(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid(),c.isValid()?(e.$setValidity("time",!0),!0):(e.$setValidity("time",!1),e.$setViewValue(null),!1)}function i(a){var c;return c=moment.tz?a?moment(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid(),c=b.constrainToReference(c),!c.isValid()||c.isBefore(b.startTime)||c.isAfter(b.endTime)?(e.$setValidity("bounds",!1),e.$setViewValue(null),!1):(e.$setValidity("bounds",!0),!0)}function j(a){var c;c=moment.tz?a?moment(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid();var d=c.isValid();if(d){var f=c.diff(b.startTime),g=b.interval.asMilliseconds();d=0===f%g}return d?(e.$setValidity("interval",!0),!0):(e.$setValidity("interval",!1),e.$setViewValue(null),!1)}function k(){a(function(){b.$apply()}),b.isOpen&&a(function(){l()})}function l(){var a=c.find("ul");$(a).scrollTop(0);var b=$("li.active",a),d=b.length?b.position().top:0,e=b.length?b.outerHeight(!0):0;$(a).scrollTop(d-e)}function m(){b.isOpen||(b.isOpen=!0,b.modelPreview=b.ngModel?b.ngModel.clone():b.startTime.clone(),k())}b.$watchCollection("[startTime,endTime,interval,strict]",function(){b.constrainToReference(),g()}),b.$watchCollection("[startTime,endTime,interval,ngModel]",function(){b.findActiveIndex(b.ngModel)}),e.$render=function(){var a=moment(e.$modelValue).format(b.format),c=h(a);if(b.strict&&(c=c&&i(a)&&j(a)),!c)throw new Error("The provided time value is invalid.");b.time=a},b.closePopup=function(c){c?a(function(){b.isOpen=!1},200):(b.isOpen=!1,k())},b.handleListClick=function(a){return a.preventDefault(),!1},b.select=function(a,c){var d;d=moment.tz?moment(a,b.reference.tz()):moment(a),b.time=d.format(b.format),b.activeIndex=c,b.update(),b.closePopup()},b.increment=function(){b.isOpen?(b.modelPreview.add(b.interval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview)):(b.ngModel.add(b.interval),b.ngModel=b.ensureTimeIsWithinBounds(b.ngModel),b.time=b.ngModel.format(b.format)),b.activeIndex=Math.min(b.largestPossibleIndex,b.activeIndex+1)},b.decrement=function(){b.isOpen?(b.modelPreview.subtract(b.interval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview)):(b.ngModel.subtract(b.interval),b.ngModel=b.ensureTimeIsWithinBounds(b.ngModel),b.time=b.ngModel.format(b.format)),b.activeIndex=Math.max(0,b.activeIndex-1)},b.update=function(){var a=h(b.time)&&i(b.time);if(a){var c;c=moment.tz?moment(b.time,b.format,b.reference.tz()):moment(b.time,b.format),c=b.constrainToReference(c),e.$setViewValue(c)}},b.handleKeyboardInput=function(a){switch(a.keyCode){case 13:b.modelPreview&&(b.ngModel=b.modelPreview,b.isOpen=!1);break;case 27:b.closePopup();break;case 33:m(),b.modelPreview.subtract(b.largeInterval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview),b.activeIndex=Math.max(0,b.activeIndex-b.largeIntervalIndexJump);break;case 34:m(),b.modelPreview.add(b.largeInterval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview),b.activeIndex=Math.min(b.largestPossibleIndex,b.activeIndex+b.largeIntervalIndexJump);break;case 38:m(),b.decrement();break;case 40:m(),b.increment()}k()},b.preventDefault=function(a){a.preventDefault()},b.largestPossibleIndexIs=function(a){b.largestPossibleIndex=a},b.focusInputElement=function(){$(n).focus()};var n=c.find("input"),o=c.find("ul");n.bind("focus",function(){a(m,150),b.isFocused=!0}),n.bind("blur",function(){a(function(){$(n).is(":focus")||(b.closePopup(),g())},150),b.isFocused=!1}),o.bind("mousedown",function(a){a.preventDefault()}),"function"==typeof Hamster&&Hamster(n[0]).wheel(function(a,c){b.isFocused&&(a.preventDefault(),b.activeIndex-=c,b.activeIndex=Math.min(b.largestPossibleIndex,Math.max(0,b.activeIndex)),b.select(b.dropDownOptions[b.activeIndex],b.activeIndex),k())})}}}])}(); | ||
!function(){"use strict";try{angular.module("fm.components")}catch(a){angular.module("fm.components",[])}angular.module("fm.components").filter("fmTimeFormat",function(){return function(a,b){return"number"==typeof a&&(a=moment(a)),moment(a).format(b)}}).filter("fmTimeInterval",function(){return function(a,b,c,d){if(!b||!c)return a;b=moment(b),c=moment(c),d=d||moment.duration(30,"minutes");for(var e=b.clone();+c>=+e;e.add(d))a.push(+e);return a}}).controller("fmTimepickerController",["$scope",function(a){if(a.reference=a.reference?moment(a.reference):moment(),a.style=a.style||"dropdown",a.isOpen=a.isOpen||!1,a.format=a.format||"LT",a.startTime=a.startTime||moment(a.reference).startOf("day"),a.endTime=a.endTime||moment(a.reference).endOf("day"),a.interval=a.interval||moment.duration(30,"minutes"),a.largeInterval=a.largeInterval||moment.duration(60,"minutes"),a.strict=a.strict||!1,a.btnClass=a.btnClass||"btn-default",a.strict){var b=a.ngModel.valueOf(),c=a.interval.asMilliseconds();b-=b%c,b+=c,a.ngModel=moment(b)}a.constrainToReference=function(b){return b?(b.isSame(a.reference,"day")||b.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),b):(a.startTime.isSame(a.reference,"day")||a.startTime.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),a.endTime.isSame(a.reference,"day")||a.endTime.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),a.ngModel&&!a.ngModel.isSame(a.reference,"day")&&a.ngModel.year(a.reference.year()).month(a.reference.month()).date(a.reference.date()),null)},a.constrainToReference(),a.ensureTimeIsWithinBounds=function(b){return b.isBefore(a.startTime)?moment(a.startTime):b.isAfter(a.endTime)?moment(a.endTime):b},a.ngModel=a.ensureTimeIsWithinBounds(a.ngModel),a.findActiveIndex=function(b){a.activeIndex=0;for(var c=a.startTime.clone();+c<=+a.endTime&&!c.isSame(b);c.add(a.interval),++a.activeIndex)if(c.isAfter(b)){a.strict&&(a.activeIndex=-1),a.activeIndex-=1;break}},a.largestPossibleIndex=Number.MAX_VALUE,a.largeIntervalIndexJump=Number.MAX_VALUE,a.findActiveIndex(a.ngModel),a.$watch("interval",function(b){b.asMilliseconds()<1&&(console.error("[fm-timepicker] Error: Supplied interval length is smaller than 1ms! Reverting to default."),a.interval=moment.duration(30,"minutes"))}),a.$watch("largeInterval",function(b){b.asMilliseconds()<10&&(console.error("[fm-timepicker] Error: Supplied large interval length is smaller than 10ms! Reverting to default."),a.largeInterval=moment.duration(60,"minutes"))}),a.$watchCollection("[interval,largeInterval]",function(b){var c=b[0],d=b[1],e=c.asMilliseconds(),f=d.asMilliseconds();0!==f%e&&(console.warn("[fm-timepicker] Warning: Large interval is not a multiple of interval! Using internally computed value instead."),a.largeInterval=moment.duration(5*e),f=a.largeInterval.asMilliseconds()),a.largeIntervalIndexJump=f/e})}]).directive("fmTimepickerToggle",function(){return{restrict:"A",link:function(a,b){b.bind("click",function(){a.isOpen?(a.focusInputElement(),a.closePopup()):a.focusInputElement()})}}}).directive("fmTimepicker",["$timeout",function(a){return{template:"<div> <div class='input-group'> <span class='input-group-btn' ng-if='style==\"sequential\"'> <button type='button' class='btn {{btnClass}}' ng-click='decrement()' ng-disabled='activeIndex==0'> <span class='glyphicon glyphicon-minus'></span> </button> </span> <input type='text' class='form-control' ng-model='time' ng-keyup='handleKeyboardInput($event)' ng-change='update()'> <span class='input-group-btn'> <button type='button' class='btn {{btnClass}}' ng-if='style==\"sequential\"' ng-click='increment()' ng-disabled='activeIndex==largestPossibleIndex'> <span class='glyphicon glyphicon-plus'></span> </button> <button type='button' class='btn {{btnClass}}' ng-if='style==\"dropdown\"' ng-class='{active:isOpen}' fm-timepicker-toggle> <span class='glyphicon glyphicon-time'></span> </button> </span> </div> <div class='dropdown' ng-if='style==\"dropdown\"' ng-class='{open:isOpen}'> <ul class='dropdown-menu form-control' style='height:auto; max-height:160px; overflow-y:scroll;' ng-mousedown=\"handleListClick($event)\"> <li ng-repeat='time in ( $parent.dropDownOptions = ( [] | fmTimeInterval:startTime:endTime:interval ) )' ng-click='select(time,$index)' ng-class='{active:(activeIndex==$index)}'> {{$last?largestPossibleIndexIs($index):angular.noop()}} <a href='#' ng-click='preventDefault($event)'>{{time|fmTimeFormat:format}}</a> </li> </ul> </div></div>",replace:!0,restrict:"E",scope:{ngModel:"=",format:"=?",startTime:"=?",endTime:"=?",reference:"=?",interval:"=?",largeInterval:"=?",isOpen:"=?",style:"=?",strict:"=?",btnClass:"=?"},controller:"fmTimepickerController",require:"ngModel",link:function(b,c,d,e){function f(a){e.$setValidity("time",a),e.$setValidity("bounds",a),e.$setValidity("interval",a)}function g(){f(!0);var a=h(b.time);if(b.strict&&(a=a&&i(b.time)&&j(b.time)),a){var c;c=moment.tz?moment.tz(b.time,b.format,b.reference.tz()):moment(b.time,b.format),c=b.constrainToReference(c),e.$setViewValue(c),b.time=moment.tz?moment.tz(b.time,b.format,b.reference.tz()).format(b.format):moment(b.time,b.format).format(b.format)}}function h(a){var c;return c=moment.tz?a?moment.tz(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid(),c.isValid()?(e.$setValidity("time",!0),!0):(e.$setValidity("time",!1),e.$setViewValue(null),!1)}function i(a){var c;return c=moment.tz?a?moment.tz(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid(),c=b.constrainToReference(c),!c.isValid()||c.isBefore(b.startTime)||c.isAfter(b.endTime)?(e.$setValidity("bounds",!1),e.$setViewValue(null),!1):(e.$setValidity("bounds",!0),!0)}function j(a){var c;c=moment.tz?a?moment.tz(a,b.format,b.reference.tz()):moment.invalid():a?moment(a,b.format):moment.invalid();var d=c.isValid();if(d){var f=c.diff(b.startTime),g=b.interval.asMilliseconds();d=0===f%g}return d?(e.$setValidity("interval",!0),!0):(e.$setValidity("interval",!1),e.$setViewValue(null),!1)}function k(){a(function(){b.$apply()}),b.isOpen&&a(l)}function l(){var a=c.find("ul");$(a).scrollTop(0);var b=$("li.active",a),d=b.length?b.position().top:0,e=b.length?b.outerHeight(!0):0;$(a).scrollTop(d-e)}function m(){b.isOpen||(b.isOpen=!0,b.modelPreview=b.ngModel?b.ngModel.clone():b.startTime.clone(),a(k))}b.$watchCollection("[startTime,endTime,interval,strict]",function(){b.constrainToReference(),g()}),b.$watchCollection("[startTime,endTime,interval,ngModel]",function(){b.findActiveIndex(b.ngModel)}),e.$render=function(){var a=moment(e.$modelValue).format(b.format),c=h(a);if(b.strict&&(c=c&&i(a)&&j(a)),!c)throw new Error("The provided time value is invalid.");b.time=a},b.closePopup=function(c){c?a(function(){b.isOpen=!1},200):(b.isOpen=!1,a(k))},b.handleListClick=function(a){return a.preventDefault(),!1},b.select=function(a,c){var d;d=moment.tz?moment(a).tz(b.reference.tz()):moment(a),b.time=d.format(b.format),b.activeIndex=c,b.update(),b.closePopup()},b.increment=function(){b.isOpen?(b.modelPreview.add(b.interval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview)):(b.ngModel.add(b.interval),b.ngModel=b.ensureTimeIsWithinBounds(b.ngModel),b.time=b.ngModel.format(b.format)),b.activeIndex=Math.min(b.largestPossibleIndex,b.activeIndex+1)},b.decrement=function(){b.isOpen?(b.modelPreview.subtract(b.interval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview)):(b.ngModel.subtract(b.interval),b.ngModel=b.ensureTimeIsWithinBounds(b.ngModel),b.time=b.ngModel.format(b.format)),b.activeIndex=Math.max(0,b.activeIndex-1)},b.update=function(){var a=h(b.time)&&i(b.time);if(a){var c;c=moment.tz?moment.tz(b.time,b.format,b.reference.tz()):moment(b.time,b.format),c=b.constrainToReference(c),e.$setViewValue(c)}},b.handleKeyboardInput=function(c){switch(c.keyCode){case 13:b.modelPreview&&(b.ngModel=b.modelPreview,b.isOpen=!1);break;case 27:b.closePopup();break;case 33:m(),b.modelPreview.subtract(b.largeInterval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview),b.activeIndex=Math.max(0,b.activeIndex-b.largeIntervalIndexJump);break;case 34:m(),b.modelPreview.add(b.largeInterval),b.modelPreview=b.ensureTimeIsWithinBounds(b.modelPreview),b.activeIndex=Math.min(b.largestPossibleIndex,b.activeIndex+b.largeIntervalIndexJump);break;case 38:m(),b.decrement();break;case 40:m(),b.increment()}a(k)},b.preventDefault=function(a){a.preventDefault()},b.largestPossibleIndexIs=function(a){b.largestPossibleIndex=a},b.focusInputElement=function(){$(n).focus()};var n=c.find("input"),o=c.find("ul");n.bind("focus",function(){a(m,150),b.isFocused=!0}),n.bind("blur",function(){a(function(){$(n).is(":focus")||(b.closePopup(),g())},150),b.isFocused=!1}),o.bind("mousedown",function(a){a.preventDefault()}),"function"==typeof Hamster&&Hamster(n[0]).wheel(function(c,d){b.isFocused&&(c.preventDefault(),b.activeIndex-=d,b.activeIndex=Math.min(b.largestPossibleIndex,Math.max(0,b.activeIndex)),b.select(b.dropDownOptions[b.activeIndex],b.activeIndex),a(k))})}}}])}(); |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ module.exports = function( grunt ) { |
{ | ||
"name": "fm-timepicker", | ||
"version": "3.0.0", | ||
"version": "3.0.3", | ||
"description": "time picker", | ||
@@ -5,0 +5,0 @@ "main": "src/fm-timepicker.js", |
@@ -0,0 +0,0 @@ fm-timepicker |
@@ -85,2 +85,7 @@ /** | ||
if( moment.tz ) { | ||
$scope.startTime.tz( $scope.reference.tz() ); | ||
$scope.endTime.tz( $scope.reference.tz() ); | ||
} | ||
if( $scope.strict ) { | ||
@@ -107,2 +112,6 @@ // Round the model value up to the next valid time that fits the configured interval. | ||
if( day ) { | ||
if( moment.tz ) { | ||
day.tz( $scope.reference.tz() ); | ||
} | ||
if( !day.isSame( $scope.reference, "day" ) ) { | ||
@@ -366,3 +375,4 @@ day.year( $scope.reference.year() ).month( $scope.reference.month() ).date( $scope.reference.date() ); | ||
if( moment.tz ) { | ||
time = timeString ? moment.tz( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -391,3 +401,4 @@ scope.reference.tz() ) : moment.invalid(); | ||
if( moment.tz ) { | ||
time = timeString ? moment( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -417,3 +428,4 @@ scope.reference.tz() ) : moment.invalid(); | ||
if( moment.tz ) { | ||
time = timeString ? moment( timeString, | ||
time = timeString ? moment.tz( | ||
timeString, | ||
scope.format, | ||
@@ -453,5 +465,3 @@ scope.reference.tz() ) : moment.invalid(); | ||
// Use $timeout to give the DOM time to catch up. | ||
$timeout( function() { | ||
scrollSelectedItemIntoView(); | ||
} ); | ||
$timeout( scrollSelectedItemIntoView ); | ||
} | ||
@@ -485,3 +495,3 @@ } | ||
scope.modelPreview = scope.ngModel ? scope.ngModel.clone() : scope.startTime.clone(); | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -505,3 +515,3 @@ } | ||
scope.isOpen = false; | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -527,3 +537,3 @@ }; | ||
if( moment.tz ) { | ||
time = moment( timestamp, scope.reference.tz() ); | ||
time = moment( timestamp ).tz( scope.reference.tz() ); | ||
} else { | ||
@@ -574,3 +584,3 @@ time = moment( timestamp ); | ||
if( moment.tz ) { | ||
newTime = moment( scope.time, | ||
newTime = moment.tz( scope.time, | ||
scope.format, | ||
@@ -626,3 +636,3 @@ scope.reference.tz() ); | ||
} | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
}; | ||
@@ -694,3 +704,3 @@ | ||
scope.select( scope.dropDownOptions[ scope.activeIndex ], scope.activeIndex ); | ||
ensureUpdatedView(); | ||
$timeout( ensureUpdatedView ); | ||
} | ||
@@ -697,0 +707,0 @@ } ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131217
26
2196