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

angular-datetime-inputs

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-datetime-inputs - npm Package Compare versions

Comparing version 0.1.2 to 0.1.21

src/scroll-support.js

2

bower.json
{
"name": "angular-datetime-inputs",
"version": "0.1.2",
"version": "0.1.21",
"description": "UI elements for datetime input, converted to angular directives for your convenience.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/g1eb/angular-datetime-inputs",

@@ -1,3 +0,4 @@

"use strict";angular.module("g1b.datetime-inputs",[]).directive("datetimeInput",["$document",function(e){return{restrict:"E",scope:{datetime:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:'<div class="datetime-input datetime"><div class="display" ng-click="toggleEditPopover()" ng-class="{\'active\': !!selected }"><div class="date" ng-bind="datetime.format(\'DD MMMM YYYY\')"></div><div class="time" ng-bind="datetime.format(\'HH : mm : ss\')"></div><div ng-if="!datetime" class="placeholder" ng-bind="placeholder"></div></div><div class="edit-popover" ng-show="!!selected"><div class="header" ng-click="calendar_active = !calendar_active" ng-bind="selected.format(\'DD MMMM YYYY\')"></div><div class="calendar" ng-show="!!calendar_active"><div class="calendar-header"><div class="arrow arrow-left" ng-click="calendar.subtract(1, \'months\')"></div><span ng-bind="calendar.format(\'MMMM\')"></span><div class="arrow arrow-right" ng-click="calendar.add(1, \'months\')"></div></div><div class="calendar-body"><div class="weekdays"><span class="weekday" ng-repeat="weekday in \'weeeeek\' track by $index" ng-bind="calendar.clone().startOf(\'week\').add($index, \'days\').format(\'ddd\')"></span></div><div class="week" ng-repeat="week in \'months\' | limitTo: ((calendar.clone().endOf(\'month\').week() - calendar.clone().startOf(\'month\').week()) + 1) track by $index"><span class="date" ng-repeat="date in \'weeeeek\' track by $index" ng-class="{ \'current\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).startOf(\'day\').isSame(current.clone().startOf(\'day\')), \'active\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).startOf(\'day\').isSame(selected.clone().startOf(\'day\')), \'inactive\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).month() !== calendar.month() }" ng-click="update(selected.clone().year(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).year()).month(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).month()).date(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).date()), true)" ng-bind="calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).date()"></span></div></div></div><div class="timer"><div class="timer-hours"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'hours\'))"></div><span ng-bind="selected.format(\'HH\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'hours\'))"></div></div><div class="timer-divider">:</div><div class="timer-minutes"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'minutes\'))"></div><span ng-bind="selected.format(\'mm\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'minutes\'))"></div></div><div class="timer-divider">:</div><div class="timer-seconds"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'seconds\'))"></div><span ng-bind="selected.format(\'ss\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'seconds\'))"></div></div></div><div class="clear-button" ng-if="!!datetime"><div ng-click="update()">Clear</div></div></div></div>',compile:function(){return{pre:function(){},post:function(a,d){a.current=moment(),a.toggleEditPopover=function(){a.selected?a.selected=void 0:(a.selected=a.datetime||moment(),a.calendar=a.selected.clone())},a.update=function(e,d){a.selected.isSame(e)&&a.datetime||(e?(a.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()),(a.selected.clone().startOf("week").month()!==a.calendar.month()&&a.selected.clone().endOf("week").month()!==a.calendar.month()||d)&&(a.calendar=a.selected.clone())):a.selected=a.datetime=void 0,a.datetime||(a.datetime=a.selected),a.$$postDigest(function(){a.onChange()}))},a.datetime&&!a.datetime._isAMomentObject&&(a.datetime=moment(a.datetime,a.format)),e.on("mousedown",function(e){a.selected&&!d[0].contains(e.target)&&a.$apply(function(){a.selected="",a.calendar_active=!1})})}}}}}]);
"use strict";angular.module("g1b.datetime-inputs").directive("dateInput",["$document",function(e){return{restrict:"E",scope:{date:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:"<div class=\"datetime-input date\"><div class=\"display\" ng-click=\"toggleEditPopover()\" ng-class=\"{'active': !!selected }\"><div class=\"date\" ng-bind=\"date.format('DD MMMM YYYY')\"></div><div ng-if=\"!date\" class=\"placeholder\" ng-bind=\"placeholder\"></div></div><div class=\"edit-popover\" ng-show=\"!!selected\"><div class=\"header\" ng-bind=\"selected.format('DD MMMM YYYY')\"></div><div class=\"calendar\"><div class=\"calendar-header\"><div class=\"arrow arrow-left\" ng-click=\"calendar.subtract(1, 'months')\"></div><span ng-bind=\"calendar.format('MMMM')\"></span><div class=\"arrow arrow-right\" ng-click=\"calendar.add(1, 'months')\"></div></div><div class=\"calendar-body\"><div class=\"weekdays\"><span class=\"weekday\" ng-repeat=\"weekday in 'weeeeek' track by $index\" ng-bind=\"calendar.clone().startOf('week').add($index, 'days').format('ddd')\"></span></div><div class=\"week\" ng-repeat=\"week in 'months' | limitTo: ((calendar.clone().endOf('month').week() - calendar.clone().startOf('month').week()) + 1) track by $index\"><span class=\"date\" ng-repeat=\"date in 'weeeeek' track by $index\" ng-class=\"{ 'current': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(current.clone().startOf('day')), 'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')), 'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month() }\" ng-click=\"update(selected.clone().year(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).year()).month(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()), true)\" ng-bind=\"calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()\"></span></div></div></div><div class=\"clear-button\" ng-if=\"!!date\"><div ng-click=\"update()\">Clear</div></div></div></div>",compile:function(){return{pre:function(){},post:function(a,d){a.current=moment(),a.toggleEditPopover=function(){a.selected?a.selected=void 0:(a.selected=a.date||moment(),a.calendar=a.selected.clone())},a.update=function(e,d){a.selected.isSame(e)&&a.date||(e?(a.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()),(a.selected.clone().startOf("week").month()!==a.calendar.month()||d)&&(a.calendar=a.selected.clone())):a.selected=a.date=void 0,a.date||(a.date=a.selected),a.$$postDigest(function(){a.onChange()}))},a.date&&!a.date._isAMomentObject&&(a.date=moment(a.date,a.format)),e.on("mousedown",function(e){a.selected&&!d[0].contains(e.target)&&a.$apply(function(){a.selected="",a.calendar_active=!1})})}}}}}]);
"use strict";angular.module("g1b.datetime-inputs").directive("timeInput",["$document",function(e){return{restrict:"E",scope:{time:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:'<div class="datetime-input time"><div class="display" ng-click="toggleEditPopover()" ng-class="{\'active\': !!selected }"><div class="time" ng-bind="time.format(\'HH : mm : ss\')"></div><div ng-if="!time" class="placeholder" ng-bind="placeholder"></div></div><div class="edit-popover" ng-show="!!selected"><div class="header" ng-bind="selected.format(\'DD MMMM YYYY\')"></div><div class="timer"><div class="timer-hours"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'hours\'))"></div><span ng-bind="selected.format(\'HH\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'hours\'))"></div></div><div class="timer-divider">:</div><div class="timer-minutes"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'minutes\'))"></div><span ng-bind="selected.format(\'mm\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'minutes\'))"></div></div><div class="timer-divider">:</div><div class="timer-seconds"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'seconds\'))"></div><span ng-bind="selected.format(\'ss\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'seconds\'))"></div></div></div><div class="clear-button" ng-if="!!time"><div ng-click="update()">Clear</div></div></div></div>',compile:function(){return{pre:function(){},post:function(t,i){t.toggleEditPopover=function(){t.selected?t.selected=void 0:t.selected=t.time||moment()},t.update=function(e,i){t.selected.isSame(e)&&t.time||(e?t.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()):t.selected=t.time=void 0,t.time||(t.time=t.selected),t.$$postDigest(function(){t.onChange()}))},t.time&&!t.time._isAMomentObject&&(t.time=moment(t.time,t.format)),e.on("mousedown",function(e){t.selected&&!i[0].contains(e.target)&&t.$apply(function(){t.selected="",t.calendar_active=!1})})}}}}}]);
"use strict";angular.module("g1b.datetime-inputs",[]).directive("datetimeInput",["$document",function(e){return{restrict:"E",scope:{datetime:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:'<div class="datetime-input datetime"><div class="display" ng-click="toggleEditPopover()" ng-class="{\'active\': !!selected }"><div class="date" ng-bind="datetime.format(\'DD MMMM YYYY\')"></div><div class="time" ng-bind="datetime.format(\'HH : mm : ss\')"></div><div ng-if="!datetime" class="placeholder" ng-bind="placeholder"></div></div><div class="edit-popover" ng-show="!!selected"><div class="header" ng-click="calendar_active = !calendar_active" ng-bind="selected.format(\'DD MMMM YYYY\')"></div><div class="calendar" ng-show="!!calendar_active"><div class="calendar-header" scroll-up="calendar.add(1, \'months\')" scroll-down="calendar.subtract(1, \'months\')"><div class="arrow arrow-left" ng-click="calendar.subtract(1, \'months\')"></div><span ng-bind="calendar.format(\'YYYY\') === current.format(\'YYYY\') ? calendar.format(\'MMMM\') : calendar.format(\'MMMM YYYY\')"></span><div class="arrow arrow-right" ng-click="calendar.add(1, \'months\')"></div></div><div class="calendar-body"><div class="weekdays"><span class="weekday" ng-repeat="weekday in \'weeeeek\' track by $index" ng-bind="calendar.clone().startOf(\'week\').add($index, \'days\').format(\'ddd\')"></span></div><div class="week" ng-repeat="week in \'months\' | limitTo: ((calendar.clone().endOf(\'month\').week() - calendar.clone().startOf(\'month\').week()) + 1) track by $index"><span class="date" ng-repeat="date in \'weeeeek\' track by $index" ng-class="{ \'current\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).startOf(\'day\').isSame(current.clone().startOf(\'day\')), \'active\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).startOf(\'day\').isSame(selected.clone().startOf(\'day\')), \'inactive\': calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).month() !== calendar.month() }" ng-click="update(selected.clone().year(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).year()).month(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).month()).date(calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).date()), true)" ng-bind="calendar.clone().startOf(\'month\').add($parent.$index, \'weeks\').weekday($index).date()"></span></div></div></div><div class="timer"><div class="timer-hours"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'hours\'))"></div><span ng-bind="selected.format(\'HH\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'hours\'))"></div></div><div class="timer-divider">:</div><div class="timer-minutes"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'minutes\'))"></div><span ng-bind="selected.format(\'mm\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'minutes\'))"></div></div><div class="timer-divider">:</div><div class="timer-seconds"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'seconds\'))"></div><span ng-bind="selected.format(\'ss\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'seconds\'))"></div></div></div><div class="clear-button" ng-if="!!datetime"><div ng-click="update()">Clear</div></div></div></div>',compile:function(){return{pre:function(){},post:function(a,d){a.current=moment(),a.datetime&&!a.datetime._isAMomentObject&&(a.datetime=moment(a.datetime,a.format)),a.toggleEditPopover=function(){a.selected?a.selected=void 0:(a.selected=a.datetime||moment(),a.calendar=a.selected.clone())},a.update=function(e,d){a.selected.isSame(e)&&a.datetime||(e?(a.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()),(a.selected.clone().startOf("week").month()!==a.calendar.month()&&a.selected.clone().endOf("week").month()!==a.calendar.month()||d)&&(a.calendar=a.selected.clone())):a.selected=a.datetime=void 0,a.datetime||(a.datetime=a.selected),a.$$postDigest(function(){a.onChange()}))},a.close=function(){a.selected="",a.calendar_active=!1},e.on("mousedown",function(e){a.selected&&!d[0].contains(e.target)&&a.$apply(function(){a.close()})})}}}}}]);
"use strict";angular.module("g1b.datetime-inputs").directive("dateInput",["$document",function(e){return{restrict:"E",scope:{date:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:"<div class=\"datetime-input date\"><div class=\"display\" ng-click=\"toggleEditPopover()\" ng-class=\"{'active': !!selected }\"><div class=\"date\" ng-bind=\"date.format('DD MMMM YYYY')\"></div><div ng-if=\"!date\" class=\"placeholder\" ng-bind=\"placeholder\"></div></div><div class=\"edit-popover\" ng-show=\"!!selected\"><div class=\"header\" ng-bind=\"selected.format('DD MMMM YYYY')\"></div><div class=\"calendar\"><div class=\"calendar-header\" scroll-up=\"calendar.add(1, 'months')\" scroll-down=\"calendar.subtract(1, 'months')\"><div class=\"arrow arrow-left\" ng-click=\"calendar.subtract(1, 'months')\"></div><span ng-bind=\"calendar.format('YYYY') === current.format('YYYY') ? calendar.format('MMMM') : calendar.format('MMMM YYYY')\"></span><div class=\"arrow arrow-right\" ng-click=\"calendar.add(1, 'months')\"></div></div><div class=\"calendar-body\"><div class=\"weekdays\"><span class=\"weekday\" ng-repeat=\"weekday in 'weeeeek' track by $index\" ng-bind=\"calendar.clone().startOf('week').add($index, 'days').format('ddd')\"></span></div><div class=\"week\" ng-repeat=\"week in 'months' | limitTo: ((calendar.clone().endOf('month').week() - calendar.clone().startOf('month').week()) + 1) track by $index\"><span class=\"date\" ng-repeat=\"date in 'weeeeek' track by $index\" ng-class=\"{ 'current': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(current.clone().startOf('day')), 'active': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).startOf('day').isSame(selected.clone().startOf('day')), 'inactive': calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month() !== calendar.month() }\" ng-click=\"update(selected.clone().year(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).year()).month(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).month()).date(calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()), true)\" ng-bind=\"calendar.clone().startOf('month').add($parent.$index, 'weeks').weekday($index).date()\"></span></div></div></div><div class=\"clear-button\" ng-if=\"!!date\"><div ng-click=\"update()\">Clear</div></div></div></div>",compile:function(){return{pre:function(){},post:function(a,d){a.current=moment(),a.date&&!a.date._isAMomentObject&&(a.date=moment(a.date,a.format)),a.toggleEditPopover=function(){a.selected?a.selected=void 0:(a.selected=a.date||moment(),a.calendar=a.selected.clone())},a.update=function(e,d){a.selected.isSame(e)&&a.date||(e?(a.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()),(a.selected.clone().startOf("week").month()!==a.calendar.month()||d)&&(a.calendar=a.selected.clone())):a.selected=a.date=void 0,a.date||(a.date=a.selected),a.$$postDigest(function(){a.onChange()}),a.close())},a.close=function(){a.selected="",a.calendar_active=!1},e.on("mousedown",function(e){a.selected&&!d[0].contains(e.target)&&a.$apply(function(){a.close()})})}}}}}]);
"use strict";angular.module("g1b.datetime-inputs").directive("timeInput",["$document",function(e){return{restrict:"E",scope:{time:"=",format:"=?",onChange:"&",placeholder:"@"},replace:!0,template:'<div class="datetime-input time"><div class="display" ng-click="toggleEditPopover()" ng-class="{\'active\': !!selected }"><div class="time" ng-bind="time.format(\'HH : mm : ss\')"></div><div ng-if="!time" class="placeholder" ng-bind="placeholder"></div></div><div class="edit-popover" ng-show="!!selected"><div class="header" ng-bind="selected.format(\'DD MMMM YYYY\')"></div><div class="timer"><div class="timer-hours"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'hours\'))"></div><span ng-bind="selected.format(\'HH\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'hours\'))"></div></div><div class="timer-divider">:</div><div class="timer-minutes"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'minutes\'))"></div><span ng-bind="selected.format(\'mm\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'minutes\'))"></div></div><div class="timer-divider">:</div><div class="timer-seconds"><div class="arrow arrow-up" ng-click="update(selected.clone().add(1, \'seconds\'))"></div><span ng-bind="selected.format(\'ss\')"></span><div class="arrow arrow-down" ng-click="update(selected.clone().subtract(1, \'seconds\'))"></div></div></div><div class="clear-button" ng-if="!!time"><div ng-click="update()">Clear</div></div></div></div>',compile:function(){return{pre:function(){},post:function(t,i){t.time&&!t.time._isAMomentObject&&(t.time=moment(t.time,t.format)),t.toggleEditPopover=function(){t.selected?t.selected=void 0:t.selected=t.time||moment()},t.update=function(e,i){t.selected.isSame(e)&&t.time||(e?t.selected.year(e.year()).month(e.month()).date(e.date()).hours(e.hours()).minutes(e.minutes()).seconds(e.seconds()):t.selected=t.time=void 0,t.time||(t.time=t.selected),t.$$postDigest(function(){t.onChange()}))},t.close=function(){t.selected=""},e.on("mousedown",function(e){t.selected&&!i[0].contains(e.target)&&t.$apply(function(){t.close()})})}}}}}]);
angular.module("g1b.datetime-inputs").directive("scrollUp",function(){return{restrict:"A",compile:function(){return{pre:function(){},post:function(e,n,t){n.bind("DOMMouseScroll mousewheel wheel",function(n){n=n.originalEvent||n;var l=n.wheelDelta||-1*n.deltaY||0;l>0&&(e.$apply(function(){e.$eval(t.scrollUp)}),n.preventDefault())})}}}}}),angular.module("g1b.datetime-inputs").directive("scrollDown",function(){return{restrict:"A",compile:function(){return{pre:function(){},post:function(e,n,t){n.bind("DOMMouseScroll mousewheel wheel",function(n){n=n.originalEvent||n;var l=n.wheelDelta||-1*n.deltaY||0;l<0&&(e.$apply(function(){e.$eval(t.scrollDown)}),n.preventDefault())})}}}}});

@@ -10,3 +10,3 @@ 'use strict';

gulp.task('build', function () {
gulp.src(['src/datetime-input.js', 'src/date-input.js', 'src/time-input.js'])
gulp.src(['src/datetime-input.js', 'src/date-input.js', 'src/time-input.js', 'src/scroll-support.js'])
.pipe(embedTemplates())

@@ -13,0 +13,0 @@ .pipe(uglify())

{
"name": "angular-datetime-inputs",
"version": "0.1.2",
"version": "0.1.21",
"description": "UI elements for datetime input, converted to angular directives for your convenience.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/g1eb/angular-datetime-inputs#readme",

@@ -26,2 +26,7 @@ 'use strict';

// Convert date object to moment.js if its not a moment object yet
if ( scope.date && !scope.date._isAMomentObject ) {
scope.date = moment(scope.date, scope.format);
}
// Toggle edit popover

@@ -54,7 +59,9 @@ scope.toggleEditPopover = function () {

});
scope.close();
};
// Convert date object to moment.js if its not a moment object yet
if ( scope.date && !scope.date._isAMomentObject ) {
scope.date = moment(scope.date, scope.format);
// Close edit popover
scope.close = function () {
scope.selected = '';
scope.calendar_active = false;
}

@@ -66,4 +73,3 @@

scope.$apply(function () {
scope.selected = '';
scope.calendar_active = false;
scope.close();
});

@@ -70,0 +76,0 @@ }

@@ -26,2 +26,7 @@ 'use strict';

// Convert datetime object to moment.js if its not a moment object yet
if ( scope.datetime && !scope.datetime._isAMomentObject ) {
scope.datetime = moment(scope.datetime, scope.format);
}
// Toggle edit popover

@@ -56,5 +61,6 @@ scope.toggleEditPopover = function () {

// Convert datetime object to moment.js if its not a moment object yet
if ( scope.datetime && !scope.datetime._isAMomentObject ) {
scope.datetime = moment(scope.datetime, scope.format);
// Close edit popover
scope.close = function () {
scope.selected = '';
scope.calendar_active = false;
}

@@ -66,4 +72,3 @@

scope.$apply(function () {
scope.selected = '';
scope.calendar_active = false;
scope.close();
});

@@ -70,0 +75,0 @@ }

@@ -23,2 +23,7 @@ 'use strict';

// Convert time object to moment.js if its not a moment object yet
if ( scope.time && !scope.time._isAMomentObject ) {
scope.time = moment(scope.time, scope.format);
}
// Toggle edit popover

@@ -49,5 +54,5 @@ scope.toggleEditPopover = function () {

// Convert time object to moment.js if its not a moment object yet
if ( scope.time && !scope.time._isAMomentObject ) {
scope.time = moment(scope.time, scope.format);
// Close edit popover
scope.close = function () {
scope.selected = '';
}

@@ -59,4 +64,3 @@

scope.$apply(function () {
scope.selected = '';
scope.calendar_active = false;
scope.close();
});

@@ -63,0 +67,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