File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ angular.module('g1b.datetime-range', []).
2424 // Get current date
2525 scope . current = moment ( ) ;
2626
27+ // Convert start datetime to moment.js if its not a moment object yet
28+ if ( scope . start && ! scope . start . _isAMomentObject ) {
29+ scope . start = moment ( scope . start ) ;
30+ }
31+
32+ // Convert end datetime to moment.js if its not a moment object yet
33+ if ( scope . end && ! scope . end . _isAMomentObject ) {
34+ scope . end = moment ( scope . end ) ;
35+ }
36+
2737 // Set selected date
2838 scope . selectDate = function ( date ) {
2939 if ( scope . selected === date ) {
@@ -81,16 +91,6 @@ angular.module('g1b.datetime-range', []).
8191 }
8292 } ;
8393
84- // Convert start datetime to moment.js if its not a moment object yet
85- if ( scope . start && ! scope . start . _isAMomentObject ) {
86- scope . start = moment ( scope . start ) ;
87- }
88-
89- // Convert end datetime to moment.js if its not a moment object yet
90- if ( scope . end && ! scope . end . _isAMomentObject ) {
91- scope . end = moment ( scope . end ) ;
92- }
93-
9494 // Close edit popover
9595 scope . close = function ( ) {
9696 scope . selected = '' ;
You can’t perform that action at this time.
0 commit comments