Socket
Socket
Sign inDemoInstall

datepicker-bootstrap

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.5.1 to 1.6.0

js/tree.js

22

js/core.js
/*
* Gijgo JavaScript Library v1.5.1
* Gijgo JavaScript Library v1.6.0
* http://gijgo.com/

@@ -248,2 +248,6 @@ *

/** */ gj.core = {
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
monthShortNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
/** */ parseDate: function (value, format) {

@@ -264,3 +268,7 @@ var i, date, month, year, dateParts, formatParts, result;

} else if (['m', 'mm'].indexOf(formatParts[i]) > -1) {
month = parseInt(dateParts[i], 10);
month = parseInt(dateParts[i], 10) - 1;
} else if ('mmm' === formatParts[i]) {
month = gj.core.monthShortNames.indexOf(dateParts[i]);
} else if ('mmmm' === formatParts[i]) {
month = gj.core.monthNames.indexOf(dateParts[i]);
} else if (['yy', 'yyyy'].indexOf(formatParts[i]) > -1) {

@@ -273,3 +281,3 @@ year = parseInt(dateParts[i], 10);

}
result = new Date(year, month - 1, date);
result = new Date(year, month, date);
}

@@ -342,5 +350,11 @@ } else if (typeof value === 'number') {

break;
case 'mm' :
case 'mm':
result += pad(date.getMonth() + 1) + separator;
break;
case 'mmm':
result += gj.core.monthShortNames[date.getMonth()] + separator;
break;
case 'mmmm':
result += gj.core.monthNames[date.getMonth()] + separator;
break;
case 'yy' :

@@ -347,0 +361,0 @@ result += date.getFullYear().toString().substr(2) + separator;

2

js/core.min.js

@@ -1,1 +0,1 @@

"undefined"==typeof gj&&(gj={}),gj.widget=function(){var a=this;a.xhr=null,a.generateGUID=function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},a.mouseX=function(a){if(a){if(a.pageX)return a.pageX;if(a.clientX)return a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);if(a.touches&&a.touches.length)return a.touches[0].pageX;if(a.changedTouches&&a.changedTouches.length)return a.changedTouches[0].pageX;if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length)return a.originalEvent.touches[0].pageX;if(a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches.length)return a.originalEvent.touches[0].pageX}return null},a.mouseY=function(a){if(a){if(a.pageY)return a.pageY;if(a.clientY)return a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);if(a.touches&&a.touches.length)return a.touches[0].pageY;if(a.changedTouches&&a.changedTouches.length)return a.changedTouches[0].pageY;if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length)return a.originalEvent.touches[0].pageY;if(a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches.length)return a.originalEvent.touches[0].pageY}return null}},gj.widget.prototype.init=function(a,b){var c,d,e;this.attr("data-type",b),d=$.extend(!0,{},this.getHTMLConfig()||{}),$.extend(!0,d,a||{}),e=this.getConfig(d,b),this.attr("data-guid",e.guid),this.data(e);for(c in e)gj[b].events.hasOwnProperty(c)&&(this.on(c,e[c]),delete e[c]);for(plugin in gj[b].plugins)gj[b].plugins.hasOwnProperty(plugin)&&gj[b].plugins[plugin].configure(this,e,d);return this},gj.widget.prototype.getConfig=function(a,b){var c,d,e,f;c=$.extend(!0,{},gj[b].config.base),d=a.hasOwnProperty("uiLibrary")?a.uiLibrary:c.uiLibrary,gj[b].config[d]&&$.extend(!0,c,gj[b].config[d]),e=a.hasOwnProperty("iconsLibrary")?a.iconsLibrary:c.iconsLibrary,gj[b].config[e]&&$.extend(!0,c,gj[b].config[e]);for(f in gj[b].plugins)gj[b].plugins.hasOwnProperty(f)&&($.extend(!0,c,gj[b].plugins[f].config.base),gj[b].plugins[f].config[d]&&$.extend(!0,c,gj[b].plugins[f].config[d]),gj[b].plugins[f].config[e]&&$.extend(!0,c,gj[b].plugins[f].config[e]));return $.extend(!0,c,a),c.guid||(c.guid=this.generateGUID()),c},gj.widget.prototype.getHTMLConfig=function(){var a=this.data(),b=this[0].attributes;return b.width&&(a.width=b.width.nodeValue),b.height&&(a.height=b.height.nodeValue),b.align&&(a.align=b.align.nodeValue),a&&a.source&&(a.dataSource=a.source,delete a.source),a},gj.widget.prototype.createDoneHandler=function(){var a=this;return function(b){"string"==typeof b&&JSON&&(b=JSON.parse(b)),gj[a.data("type")].methods.render(a,b)}},gj.widget.prototype.createErrorHandler=function(){return function(a){a&&a.statusText&&"abort"!==a.statusText&&alert(a.statusText)}},gj.widget.prototype.reload=function(a){var b,c,d=this.data(),e=this.data("type");return void 0===d.dataSource&&gj[e].methods.useHtmlDataSource(this,d),$.extend(d.params,a),$.isArray(d.dataSource)?(c=gj[e].methods.filter(this),gj[e].methods.render(this,c)):"string"==typeof d.dataSource?(b={url:d.dataSource,data:d.params},this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b).done(this.createDoneHandler()).fail(this.createErrorHandler())):"object"==typeof d.dataSource&&(d.dataSource.data||(d.dataSource.data={}),$.extend(d.dataSource.data,d.params),b=$.extend(!0,{},d.dataSource),"json"===b.dataType&&"object"==typeof b.data&&(b.data=JSON.stringify(b.data)),b.success||(b.success=this.createDoneHandler()),b.error||(b.error=this.createErrorHandler()),this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b)),this},gj.documentManager={events:{},subscribeForEvent:function(a,b,c){if(gj.documentManager.events[a]&&0!==gj.documentManager.events[a].length){if(gj.documentManager.events[a][b])throw"Event "+a+' for widget with guid="'+b+'" is already attached.';gj.documentManager.events[a].push({widgetId:b,callback:c})}else gj.documentManager.events[a]=[{widgetId:b,callback:c}],$(document).on(a,gj.documentManager.executeCallbacks)},executeCallbacks:function(a){var b=gj.documentManager.events[a.type];if(b)for(var c=0;c<b.length;c++)b[c].callback(a)},unsubscribeForEvent:function(a,b){var c=!1,d=gj.documentManager.events[a];if(d)for(var e=0;e<d.length;e++)d[e].widgetId===b&&(d.splice(e,1),c=!0,0===d.length&&($(document).off(a),delete gj.documentManager.events[a]));if(!c)throw'The "'+a+'" for widget with guid="'+b+"\" can't be removed."}},gj.core={parseDate:function(a,b){var c,d,e,f,g,h,i;if(a&&"string"==typeof a){if(/^\d+$/.test(a))i=new Date(a);else if(a.indexOf("/Date(")>-1)i=new Date(parseInt(a.substr(6),10));else if(a){for(g=a.split(/[\s,-\.\/\/\:]+/),h=b.split(/[\s,-\.\/\/\:]+/),c=0;c<h.length;c++)["d","dd"].indexOf(h[c])>-1?d=parseInt(g[c],10):["m","mm"].indexOf(h[c])>-1?e=parseInt(g[c],10):["yy","yyyy"].indexOf(h[c])>-1&&(f=parseInt(g[c],10),"yy"===h[c]&&(f+=2e3));i=new Date(f,e-1,d)}}else"number"==typeof a?i=new Date(a):a instanceof Date&&(i=a);return i},formatDate:function(a,b){var c,d,e="",f=b.split(/[\s,-\.\/\/\:]+/),g=b.replace(/[shtdmyHTDMY]/g,""),h=function(a,b){for(a=String(a),b=b||2;a.length<b;)a="0"+a;return a};for(i=0;i<f.length;i++)switch(c=g[i]||"",f[i]){case"s":e+=a.getSeconds()+c;break;case"ss":e+=h(a.getSeconds())+c;break;case"M":e+=a.getMinutes()+c;break;case"MM":e+=h(a.getMinutes())+c;break;case"H":e+=a.getHours()+c;break;case"HH":e+=h(a.getHours())+c;break;case"h":d=a.getHours()>12?a.getHours()%12:a.getHours(),e+=d+c;break;case"hh":d=a.getHours()>12?a.getHours()%12:a.getHours(),e+=h(d)+c;break;case"tt":e+=(a.getHours()>=12?"pm":"am")+c;break;case"TT":e+=(a.getHours()>=12?"PM":"AM")+c;break;case"d":e+=a.getDate()+c;break;case"dd":e+=h(a.getDate())+c;break;case"m":e+=a.getMonth()+1+c;break;case"mm":e+=h(a.getMonth()+1)+c;break;case"yy":e+=a.getFullYear().toString().substr(2)+c;break;case"yyyy":e+=a.getFullYear()+c}return e},isIE:function(){return!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g)}};
"undefined"==typeof gj&&(gj={}),gj.widget=function(){var a=this;a.xhr=null,a.generateGUID=function(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},a.mouseX=function(a){if(a){if(a.pageX)return a.pageX;if(a.clientX)return a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);if(a.touches&&a.touches.length)return a.touches[0].pageX;if(a.changedTouches&&a.changedTouches.length)return a.changedTouches[0].pageX;if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length)return a.originalEvent.touches[0].pageX;if(a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches.length)return a.originalEvent.touches[0].pageX}return null},a.mouseY=function(a){if(a){if(a.pageY)return a.pageY;if(a.clientY)return a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);if(a.touches&&a.touches.length)return a.touches[0].pageY;if(a.changedTouches&&a.changedTouches.length)return a.changedTouches[0].pageY;if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length)return a.originalEvent.touches[0].pageY;if(a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches.length)return a.originalEvent.touches[0].pageY}return null}},gj.widget.prototype.init=function(a,b){var c,d,e;this.attr("data-type",b),d=$.extend(!0,{},this.getHTMLConfig()||{}),$.extend(!0,d,a||{}),e=this.getConfig(d,b),this.attr("data-guid",e.guid),this.data(e);for(c in e)gj[b].events.hasOwnProperty(c)&&(this.on(c,e[c]),delete e[c]);for(plugin in gj[b].plugins)gj[b].plugins.hasOwnProperty(plugin)&&gj[b].plugins[plugin].configure(this,e,d);return this},gj.widget.prototype.getConfig=function(a,b){var c,d,e,f;c=$.extend(!0,{},gj[b].config.base),d=a.hasOwnProperty("uiLibrary")?a.uiLibrary:c.uiLibrary,gj[b].config[d]&&$.extend(!0,c,gj[b].config[d]),e=a.hasOwnProperty("iconsLibrary")?a.iconsLibrary:c.iconsLibrary,gj[b].config[e]&&$.extend(!0,c,gj[b].config[e]);for(f in gj[b].plugins)gj[b].plugins.hasOwnProperty(f)&&($.extend(!0,c,gj[b].plugins[f].config.base),gj[b].plugins[f].config[d]&&$.extend(!0,c,gj[b].plugins[f].config[d]),gj[b].plugins[f].config[e]&&$.extend(!0,c,gj[b].plugins[f].config[e]));return $.extend(!0,c,a),c.guid||(c.guid=this.generateGUID()),c},gj.widget.prototype.getHTMLConfig=function(){var a=this.data(),b=this[0].attributes;return b.width&&(a.width=b.width.nodeValue),b.height&&(a.height=b.height.nodeValue),b.align&&(a.align=b.align.nodeValue),a&&a.source&&(a.dataSource=a.source,delete a.source),a},gj.widget.prototype.createDoneHandler=function(){var a=this;return function(b){"string"==typeof b&&JSON&&(b=JSON.parse(b)),gj[a.data("type")].methods.render(a,b)}},gj.widget.prototype.createErrorHandler=function(){return function(a){a&&a.statusText&&"abort"!==a.statusText&&alert(a.statusText)}},gj.widget.prototype.reload=function(a){var b,c,d=this.data(),e=this.data("type");return void 0===d.dataSource&&gj[e].methods.useHtmlDataSource(this,d),$.extend(d.params,a),$.isArray(d.dataSource)?(c=gj[e].methods.filter(this),gj[e].methods.render(this,c)):"string"==typeof d.dataSource?(b={url:d.dataSource,data:d.params},this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b).done(this.createDoneHandler()).fail(this.createErrorHandler())):"object"==typeof d.dataSource&&(d.dataSource.data||(d.dataSource.data={}),$.extend(d.dataSource.data,d.params),b=$.extend(!0,{},d.dataSource),"json"===b.dataType&&"object"==typeof b.data&&(b.data=JSON.stringify(b.data)),b.success||(b.success=this.createDoneHandler()),b.error||(b.error=this.createErrorHandler()),this.xhr&&this.xhr.abort(),this.xhr=$.ajax(b)),this},gj.documentManager={events:{},subscribeForEvent:function(a,b,c){if(gj.documentManager.events[a]&&0!==gj.documentManager.events[a].length){if(gj.documentManager.events[a][b])throw"Event "+a+' for widget with guid="'+b+'" is already attached.';gj.documentManager.events[a].push({widgetId:b,callback:c})}else gj.documentManager.events[a]=[{widgetId:b,callback:c}],$(document).on(a,gj.documentManager.executeCallbacks)},executeCallbacks:function(a){var b=gj.documentManager.events[a.type];if(b)for(var c=0;c<b.length;c++)b[c].callback(a)},unsubscribeForEvent:function(a,b){var c=!1,d=gj.documentManager.events[a];if(d)for(var e=0;e<d.length;e++)d[e].widgetId===b&&(d.splice(e,1),c=!0,0===d.length&&($(document).off(a),delete gj.documentManager.events[a]));if(!c)throw'The "'+a+'" for widget with guid="'+b+"\" can't be removed."}},gj.core={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],parseDate:function(a,b){var c,d,e,f,g,h,i;if(a&&"string"==typeof a){if(/^\d+$/.test(a))i=new Date(a);else if(a.indexOf("/Date(")>-1)i=new Date(parseInt(a.substr(6),10));else if(a){for(g=a.split(/[\s,-\.\/\/\:]+/),h=b.split(/[\s,-\.\/\/\:]+/),c=0;c<h.length;c++)["d","dd"].indexOf(h[c])>-1?d=parseInt(g[c],10):["m","mm"].indexOf(h[c])>-1?e=parseInt(g[c],10)-1:"mmm"===h[c]?e=gj.core.monthShortNames.indexOf(g[c]):"mmmm"===h[c]?e=gj.core.monthNames.indexOf(g[c]):["yy","yyyy"].indexOf(h[c])>-1&&(f=parseInt(g[c],10),"yy"===h[c]&&(f+=2e3));i=new Date(f,e,d)}}else"number"==typeof a?i=new Date(a):a instanceof Date&&(i=a);return i},formatDate:function(a,b){var c,d,e="",f=b.split(/[\s,-\.\/\/\:]+/),g=b.replace(/[shtdmyHTDMY]/g,""),h=function(a,b){for(a=String(a),b=b||2;a.length<b;)a="0"+a;return a};for(i=0;i<f.length;i++)switch(c=g[i]||"",f[i]){case"s":e+=a.getSeconds()+c;break;case"ss":e+=h(a.getSeconds())+c;break;case"M":e+=a.getMinutes()+c;break;case"MM":e+=h(a.getMinutes())+c;break;case"H":e+=a.getHours()+c;break;case"HH":e+=h(a.getHours())+c;break;case"h":d=a.getHours()>12?a.getHours()%12:a.getHours(),e+=d+c;break;case"hh":d=a.getHours()>12?a.getHours()%12:a.getHours(),e+=h(d)+c;break;case"tt":e+=(a.getHours()>=12?"pm":"am")+c;break;case"TT":e+=(a.getHours()>=12?"PM":"AM")+c;break;case"d":e+=a.getDate()+c;break;case"dd":e+=h(a.getDate())+c;break;case"m":e+=a.getMonth()+1+c;break;case"mm":e+=h(a.getMonth()+1)+c;break;case"mmm":e+=gj.core.monthShortNames[a.getMonth()]+c;break;case"mmmm":e+=gj.core.monthNames[a.getMonth()]+c;break;case"yy":e+=a.getFullYear().toString().substr(2)+c;break;case"yyyy":e+=a.getFullYear()+c}return e},isIE:function(){return!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g)}};
{
"name": "datepicker-bootstrap",
"version": "1.5.1",
"version": "1.6.0",
"description": "Datepicker by Gijgo.com is a plug-in for the jQuery Javascript library. It is a very fast and extandable tool, and will add advanced interaction controls to any date field. This plugin allows you to create datepickers using bootstrap or material design styles. Free open source tool distributed under MIT License.",

@@ -20,2 +20,3 @@ "main": "js/datepicker.js",

"bootstrap",
"bootstrap 4",
"material design",

@@ -22,0 +23,0 @@ "datepicker"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc