Forum Documentation Showcase Pricing Learn more

🗓 [FREE Plugin] Air Date/Time Picker


#246

Hello. Is there a way to disable selecting the day and only allow selecting month and year. I would like the user to start with selecting the year and then select the month and be finished. Thank you.


#247

Thanks for the very detailed explanation!

Indeed, the empty workflow did the trick.

Great that you went all this way to explain the underlaying mechanisms!


#248

Hi,

I’m getting 2 errors that appear one after the other when when I try and populate the date picker via a workflow. The below is the message on the bubble debugger that appears at the bottom of the screen. The second is a popup error.

The plugin Air Date/Time Picker threw the following error: anonymous@https://dhtiece9044ep.cloudfront.net/package/run_debug_js/fcd4e65013008ffdbf75314d4da233d5f4c90e6fe51d575b551a0315c5544ada/xfalse/x0 line 100 > Function:3:1 run/</</</<@https://dhtiece9044ep.cloudfront.net/package/run_debug_js/fcd4e65013008ffdbf75314d4da233d5f4c90e6fe51d575b551a0315c5544ada/xfalse/x0:100:30179 T@https://dhtiece9044ep.cloudfront.net/package/run_debug_js/fcd4e65013008ffdbf75314d4da233d5f4c90e6fe51d575b551a0315c5544ada/xfalse/x0:100:21472 run/</</<@https://dhtiece9044ep.cloudfront.net/package/run_debug_js/fcd4e65013008ffdbf75314d4da233d5f4c90e6fe51d575b551a0315c5544ada/xfalse/x0:100:30135

image

Please assist.


#249

I’m also open to sponsor the inline feature (with time?!). Do you have information about when this can be done and how many people are ready to sponsor?

thanks! @seanhoots


#250

I don’t know if I’m the only one being affected by this (I doubt it) but the entire plugin just broke on both the development and live version of my application. I get the following errors in the console:

WARNING: Error parsing plugin code for update (Air Date/Time Picker). Please check
function(b,a,p){function x(a){a.sort(y);return[a[0],a[a.length-1]]}function z(a,b){var c=[],d=moment(a);for(b=moment(b);d<=b;)c.push(moment(d).format(“YYYY-MM-DD”)),d=moment(d).add(1,“days”);return c}function A(a,b,h){var c=!1;for(i=0;i<a.length;i++){var d=a[i];d=d>=b&&d<=h?!0:!1;if(d){c=!0;break}}return c}function B(a,b){for(var c=!1,d=0;d<b.length;d++)if(b[d].getTime()==a.getTime()){c=!0;break}return c}p=b.data.uniqueid;var g=b.canvas.find("#"+p)[0],e=$(g);b.data.blockeddays=null!==
a.blockeddays?a.blockeddays.get(0,7):[];b.data.blockeddates=null!==a.blockeddates?a.blockeddates.get(0,300):[];b.data.initialdates=null!==a.initialdates?a.initialdates.get(0,300):[];var r=b.data.initialdates,k=b.data.blockeddays,n=b.data.blockeddates;b.data.startdate=a.startdate;b.data.rangestart=a.rangestart;b.data.rangeend=a.rangeend;b.use_auto_binding=a.use_auto_binding;var m=a.use_auto_binding?a.autobinding:b.data.startdate;var t=b.data.rangestart,u=b.data.rangeend,q=k.concat(function(){var c=
[];a.blocksundays&&c.push(0);a.blockmondays&&c.push(1);a.blocktuesdays&&c.push(2);a.blockwednesdays&&c.push(3);a.blockthursdays&&c.push(4);a.blockfridays&&c.push(5);a.blocksaturdays&&c.push(6);return c}());if(a.use_custom){var f=“D/M/YYYY”;k=a.custom_format}else"22/6/1983"==a.dateformat?(f=“D/M/YYYY”,k=“d/m/yyyy”):“6/22/1983”==a.dateformat?(f=“M/D/YYYY”,k=“m/d/yyyy”):“22 June 1983”==a.dateformat?(f=“D MMMM YYYY”,k=“d MM, yyyy”):“Wednesday 22 June 1983”==a.dateformat?(f=“dddd D MMMM YYYY”,k=“DD, d MM, yyyy”):
(f=“D-MMM-YYYY”,k=“d-M-yyyy”);var w=new Date;f=""!==a.placeholder?a.placeholder:a.onlytimepicker?“12:00 PM”:a.showtime?moment(w).format(f)+" 12:00 PM":moment(w).format(f);g.placeholder=f;var v=a.verticalposition+" “+a.horizontalposition;f=1<a.multipledatesmax?a.multipledatesmax:a.multipledates;e.datepicker({language:“English”==a.language?“en”:“French”==a.language?“fr”:“Spanish”==a.language?“es”:“German”==a.language?“de”:“Russian”==a.language?“ru”:“Italian”==a.language?“it”:“Catalan”==a.language?“ca”:
“en”,view:a.view,inline:!1,dateFormat:k,todayButton:function(){if(a.todaybutton){var c=new Date,b=c.getDay();return-1!=q.indexOf(b)?!1:c}return!1}(),autoClose:a.autoclose,clearButton:a.clearbutton,position:v,minDate:a.mindate,maxDate:a.maxdate,firstDay:“Sunday”==a.firstday?0:“Monday”==a.firstday?1:“Tuesday”==a.firstday?2:“Wednesday”==a.firstday?3:“Thursday”==a.firstday?4:“Friday”==a.firstday?5:“Friday”==a.firstday?6:”",keyboardNav:a.enablekeyboardnav,multipleDates:f,multipleDatesSeparator:a.dateseparator,
range:a.range,toggleSelected:a.toggle_selected,timepicker:a.onlytimepicker?!0:a.showtime,onlyTimepicker:a.onlytimepicker,timeFormat:“12 hour”==a.timeformat?“hh:ii AA”:“hh:ii”,minHours:a.minhrs,maxHours:a.maxhrs,hoursStep:a.hoursstep,minMinutes:a.minminutes,maxMinutes:a.maxminutes,minutesStep:a.minutesstep,onHide:function(c,d){c.update(“position”,v);d&&(c.view=a.view,b.triggerEvent(“on_hide”,function(){}))},onSelect:function(c,d,h){c=h.selectedDates;d=c.length;b.publishAutobinding(c[0]);b.publishState(“value”,
c[0]);a.range&&1<d?A(n,h.minRange,h.maxRange)?(h.removeDate(c[0]),h.removeDate(c[d-1]),b.triggerEvent(“invalid_range”,function(){})):b.publishState(“valuelist”,z(c[0],c[d-1])):b.publishState(“valuelist”,c);0<c.length?b.publishState(“range”,x©):b.publishState(“range”,null);b.triggerEvent(“date_selected”,function(){})},onShow:function(c,d){var h=(new Date).getDay();-1!=q.indexOf(h)&&(c.todayButton=!1);if(a.autoposition&&!d){var e=!1;$.each([v,“bottom left”,“bottom center”,“bottom right”,“top left”,
“top center”,“top right”],function(a,b){if(!e){c.update(“position”,b);var d=c.$datepicker[0].getBoundingClientRect(),h=0<=d.left&&d.left<=$(window).width(),f=0<=d.top&&d.top<=$(window).height(),g=0<=d.right&&d.right<=$(window).width();d=0<=d.bottom&&d.bottom<=$(window).height();h&&f&&g&&d&&(e=!0)}})}d&&b.triggerEvent(“on_show”,function(){})},onRenderCell:function(a,b){if((0<q.length||0<n.length)&&“day”==b){var c=a.getDay();c=-1!=q.indexOf©;var d=!1;if(0<n.length){var e=a.getFullYear(),f=a.getMonth(),
g=a.getDate(),k,l,m;n.forEach(function(a){k=a.getFullYear();l=parseInt(a.getMonth());m=parseInt(a.getDate());e==k&&f==l&&g==m&&(d=!0)})}return{disabled:c||d}}}});var l=e.datepicker().data(“datepicker”);a.range?l.selectDate([t,u]):a.multipledates?l.selectDate®:1<n.length&&B(m,n)?l.removeDate(m):(console.log(m),l.selectDate(m));if(a.cursor)e.on(“input”,function(){this.value=l.selectedDates.map(function(a){return l.formatDate(l.loc.dateFormat,a)}).join(l.opts.multipleDatesSeparator)});else e.prop(“readonly”,
!0);var y=function(a,b){return a>b?1:a<b?-1:0};g.disabled=a.disable?!0:!1;g=a.highlight;e=""+(".datepicker–day-name { color: “+a.daycolor+”; } “)+(”.datepicker–button { color: “+g+”; } “);e=e+(”.datepicker–cell.-selected-, .datepicker–cell.-selected-.-current-{ background: “+g+”; } “)+(”.datepicker–cell.-selected-. -focus- { background: “+g+”; } “)+(”.datepicker–cell.-current- { color: “+g+”; }")+(“input#”+p+"::placeholder { color: “+a.placeholder_color+”; opacity: 1;}");e+=“input#”+
p+":-ms-input-placeholder { color: “+a.placeholder_color+”; }";e+=“input#”+p+"::-ms-input-placeholder { color: “+a.placeholder_color+”; }";e+="";$(e).appendTo(“head”);b.data.multipledates=a.multipledates;b.data.range=a.range;b.data.str_rangestart=null!==t?moment(t).toString():null;b.data.str_rangeend=null!==u?moment(u).toString():null;b.data.str_startdate=null!==m?moment(m).toString():null;b.data.str_initialdates=[];null!==r&&(b.data.str_initialdates=r.map(function(a){return moment(a).toString()}))};
WARNING: Error parsing plugin code for initialize (Air Date/Time Picker). Please check
function(b,d){var c=“dp”+(Math.random()*Math.pow(2,54)).toString(18);var a=$(’

’);a.css(“width”,“100%”);a.css(“height”,“100%”);a.css(“cursor”,“pointer”);a.css(“transition”,“border-color 200ms ease, box-shadow 200ms ease”);a.css(“padding”,“1px 4px”);b.canvas.append(a);b.data.div=a;b.data.uniqueid=c};
WARNING: Error parsing plugin code for update (Air Date/Time Picker). Please check
function(b,a,p){function x(a){a.sort(y);return[a[0],a[a.length-1]]}function z(a,b){var c=[],d=moment(a);for(b=moment(b);d<=b;)c.push(moment(d).format(“YYYY-MM-DD”)),d=moment(d).add(1,“days”);return c}function A(a,b,h){var c=!1;for(i=0;i<a.length;i++){var d=a[i];d=d>=b&&d<=h?!0:!1;if(d){c=!0;break}}return c}function B(a,b){for(var c=!1,d=0;d<b.length;d++)if(b[d].getTime()==a.getTime()){c=!0;break}return c}p=b.data.uniqueid;var g=b.canvas.find("#"+p)[0],e=$(g);b.data.blockeddays=null!==
a.blockeddays?a.blockeddays.get(0,7):[];b.data.blockeddates=null!==a.blockeddates?a.blockeddates.get(0,300):[];b.data.initialdates=null!==a.initialdates?a.initialdates.get(0,300):[];var r=b.data.initialdates,k=b.data.blockeddays,n=b.data.blockeddates;b.data.startdate=a.startdate;b.data.rangestart=a.rangestart;b.data.rangeend=a.rangeend;b.use_auto_binding=a.use_auto_binding;var m=a.use_auto_binding?a.autobinding:b.data.startdate;var t=b.data.rangestart,u=b.data.rangeend,q=k.concat(function(){var c=
[];a.blocksundays&&c.push(0);a.blockmondays&&c.push(1);a.blocktuesdays&&c.push(2);a.blockwednesdays&&c.push(3);a.blockthursdays&&c.push(4);a.blockfridays&&c.push(5);a.blocksaturdays&&c.push(6);return c}());if(a.use_custom){var f=“D/M/YYYY”;k=a.custom_format}else"22/6/1983"==a.dateformat?(f=“D/M/YYYY”,k=“d/m/yyyy”):“6/22/1983”==a.dateformat?(f=“M/D/YYYY”,k=“m/d/yyyy”):“22 June 1983”==a.dateformat?(f=“D MMMM YYYY”,k=“d MM, yyyy”):“Wednesday 22 June 1983”==a.dateformat?(f=“dddd D MMMM YYYY”,k=“DD, d MM, yyyy”):
(f=“D-MMM-YYYY”,k=“d-M-yyyy”);var w=new Date;f=""!==a.placeholder?a.placeholder:a.onlytimepicker?“12:00 PM”:a.showtime?moment(w).format(f)+" 12:00 PM":moment(w).format(f);g.placeholder=f;var v=a.verticalposition+" “+a.horizontalposition;f=1<a.multipledatesmax?a.multipledatesmax:a.multipledates;e.datepicker({language:“English”==a.language?“en”:“French”==a.language?“fr”:“Spanish”==a.language?“es”:“German”==a.language?“de”:“Russian”==a.language?“ru”:“Italian”==a.language?“it”:“Catalan”==a.language?“ca”:
“en”,view:a.view,inline:!1,dateFormat:k,todayButton:function(){if(a.todaybutton){var c=new Date,b=c.getDay();return-1!=q.indexOf(b)?!1:c}return!1}(),autoClose:a.autoclose,clearButton:a.clearbutton,position:v,minDate:a.mindate,maxDate:a.maxdate,firstDay:“Sunday”==a.firstday?0:“Monday”==a.firstday?1:“Tuesday”==a.firstday?2:“Wednesday”==a.firstday?3:“Thursday”==a.firstday?4:“Friday”==a.firstday?5:“Friday”==a.firstday?6:”",keyboardNav:a.enablekeyboardnav,multipleDates:f,multipleDatesSeparator:a.dateseparator,
range:a.range,toggleSelected:a.toggle_selected,timepicker:a.onlytimepicker?!0:a.showtime,onlyTimepicker:a.onlytimepicker,timeFormat:“12 hour”==a.timeformat?“hh:ii AA”:“hh:ii”,minHours:a.minhrs,maxHours:a.maxhrs,hoursStep:a.hoursstep,minMinutes:a.minminutes,maxMinutes:a.maxminutes,minutesStep:a.minutesstep,onHide:function(c,d){c.update(“position”,v);d&&(c.view=a.view,b.triggerEvent(“on_hide”,function(){}))},onSelect:function(c,d,h){c=h.selectedDates;d=c.length;b.publishAutobinding(c[0]);b.publishState(“value”,
c[0]);a.range&&1<d?A(n,h.minRange,h.maxRange)?(h.removeDate(c[0]),h.removeDate(c[d-1]),b.triggerEvent(“invalid_range”,function(){})):b.publishState(“valuelist”,z(c[0],c[d-1])):b.publishState(“valuelist”,c);0<c.length?b.publishState(“range”,x©):b.publishState(“range”,null);b.triggerEvent(“date_selected”,function(){})},onShow:function(c,d){var h=(new Date).getDay();-1!=q.indexOf(h)&&(c.todayButton=!1);if(a.autoposition&&!d){var e=!1;$.each([v,“bottom left”,“bottom center”,“bottom right”,“top left”,
“top center”,“top right”],function(a,b){if(!e){c.update(“position”,b);var d=c.$datepicker[0].getBoundingClientRect(),h=0<=d.left&&d.left<=$(window).width(),f=0<=d.top&&d.top<=$(window).height(),g=0<=d.right&&d.right<=$(window).width();d=0<=d.bottom&&d.bottom<=$(window).height();h&&f&&g&&d&&(e=!0)}})}d&&b.triggerEvent(“on_show”,function(){})},onRenderCell:function(a,b){if((0<q.length||0<n.length)&&“day”==b){var c=a.getDay();c=-1!=q.indexOf©;var d=!1;if(0<n.length){var e=a.getFullYear(),f=a.getMonth(),
g=a.getDate(),k,l,m;n.forEach(function(a){k=a.getFullYear();l=parseInt(a.getMonth());m=parseInt(a.getDate());e==k&&f==l&&g==m&&(d=!0)})}return{disabled:c||d}}}});var l=e.datepicker().data(“datepicker”);a.range?l.selectDate([t,u]):a.multipledates?l.selectDate®:1<n.length&&B(m,n)?l.removeDate(m):(console.log(m),l.selectDate(m));if(a.cursor)e.on(“input”,function(){this.value=l.selectedDates.map(function(a){return l.formatDate(l.loc.dateFormat,a)}).join(l.opts.multipleDatesSeparator)});else e.prop(“readonly”,
!0);var y=function(a,b){return a>b?1:a<b?-1:0};g.disabled=a.disable?!0:!1;g=a.highlight;e=""+(".datepicker–day-name { color: “+a.daycolor+”; } “)+(”.datepicker–button { color: “+g+”; } “);e=e+(”.datepicker–cell.-selected-, .datepicker–cell.-selected-.-current-{ background: “+g+”; } “)+(”.datepicker–cell.-selected-. -focus- { background: “+g+”; } “)+(”.datepicker–cell.-current- { color: “+g+”; }")+(“input#”+p+"::placeholder { color: “+a.placeholder_color+”; opacity: 1;}");e+=“input#”+
p+":-ms-input-placeholder { color: “+a.placeholder_color+”; }";e+=“input#”+p+"::-ms-input-placeholder { color: “+a.placeholder_color+”; }";e+="";$(e).appendTo(“head”);b.data.multipledates=a.multipledates;b.data.range=a.range;b.data.str_rangestart=null!==t?moment(t).toString():null;b.data.str_rangeend=null!==u?moment(u).toString():null;b.data.str_startdate=null!==m?moment(m).toString():null;b.data.str_initialdates=[];null!==r&&(b.data.str_initialdates=r.map(function(a){return moment(a).toString()}))};
WARNING: Error parsing plugin code for initialize (Air Date/Time Picker). Please check
function(b,d){var c=“dp”+(Math.random()*Math.pow(2,54)).toString(18);var a=$(’
’);a.css(“width”,“100%”);a.css(“height”,“100%”);a.css(“cursor”,“pointer”);a.css(“transition”,“border-color 200ms ease, box-shadow 200ms ease”);a.css(“padding”,“1px 4px”);b.canvas.append(a);b.data.div=a;b.data.uniqueid=c};
WARNING: Error parsing plugin code for initialize (Air Date/Time Picker). Please check
function(b,d){var c=“dp”+(Math.random()*Math.pow(2,54)).toString(18);var a=$(’
’);a.css(“width”,“100%”);a.css(“height”,“100%”);a.css(“cursor”,“pointer”);a.css(“transition”,“border-color 200ms ease, box-shadow 200ms ease”);a.css(“padding”,“1px 4px”);b.canvas.append(a);b.data.div=a;b.data.uniqueid=c};
WARNING: Error parsing plugin code for initialize (Air Date/Time Picker). Please check
function(b,d){var c=“dp”+(Math.random()*Math.pow(2,54)).toString(18);var a=$(’
’);a.css(“width”,“100%”);a.css(“height”,“100%”);a.css(“cursor”,“pointer”);a.css(“transition”,“border-color 200ms ease, box-shadow 200ms ease”);a.css(“padding”,“1px 4px”);b.canvas.append(a);b.data.div=a;b.data.uniqueid=c};
WARNING: Error parsing plugin code for element_action (Air Date/Time Picker-reset). Please check
function(a,b,c){c=a.data.uniqueid;b=$(a.canvas.find("#"+c)[0]);if(!a.use_auto_binding){c=a.data.uniqueid;c=new Date(a.data.str_startdate);var e=new Date(a.data.str_rangestart),f=new Date(a.data.str_rangeend),d=[];0<a.data.str_initialdates.length&&(d=a.data.str_initialdates.map(function(a){return new Date(a)}));b=b.datepicker().data(“datepicker”);b.clear();a.data.range?b.selectDate([e,f]):a.data.multipledates?b.selectDate(d):null!==a.data.str_startdate&&b.selectDate©}};
WARNING: Error parsing plugin code for element_action (Air Date/Time Picker-set date). Please check
function(a,b,c){$(a.canvas.find("#"+a.data.uniqueid)[0]).datepicker().data(“datepicker”).selectDate(b.thedate)};
WARNING: Error parsing plugin code for element_action (Air Date/Time Picker-show datepicker). Please check
function(a,b,c){$(a.canvas.find("#"+a.data.uniqueid)[0]).datepicker().data(“datepicker”).show()};

#251

Same here…


#252

I’m getting console errors like this as well… But I’m not sure where they are coming from. Page I’m editing has only 1 plug-in on it: the JAVASCRIPT EXPRESSION plug-in (from Toolbox, I think?)


#253

Yeah I think this is a bubble issue because my CSS tools plugin is having the same issue. I’m raising a bubble bug report.


#254

Yeah my guess is a general BUBBLE issue… Thanks for raising a high-priority bug report. So glad someone here posted about the issue – I’ve been flummoxed for a few minutes! Thx, K


#255

No worries! If I don’t have this plugin I don’t have an app lol. I don’t know if it’s related to the breaking change for responsivness they just pushed, but I still get the errors even if I’m on the prior version so it’s probably not related to that.


#256

Yeah, this all-of-a-sudden issue breaks my app as well. I’m getting console errors that look like:

WARNING: Error parsing plugin code for update (Expression). Please check
function(instance, properties, context) {

Which I take to mean that Bubble is generally having trouble dealing with plugin code at the moment… Grumble. Guess it might be time for a cocktail break or something.


#257

Yep I’m going to go on a bike ride and hopefully it’s back after a couple miles lol


#258

Guys could you file a bug report to bubble.
I haven’t touched the plugin code for about a week now so if something is broken it might be due to some changes from bubble’s end.


#259

Yep already done and Emmanuel got back to me so they know about the issue, first instinct was to post here but after seeing other plugins had errors as well at that point I knew it was Bubble related.


#260

Everything should be back to normal now


#261

Hi @seanhoots, is there a limit on the number of blocked dates the picker can hold? I have a booking system where users can book reservations for potentially a year or longer and I’m seeing the picker will only block up to 10 months worth of dates from the list even though the list contains 12 months. If there is a limit is there a way to get around this or could you consider raising the limit?

Thanks,
Jonathan


#262

@jonathan.timianko, i’m not sure if there is a limit.
Will have to look at my code or the plugin’s library code.


#263

Thanks


#264

Is there currently any way to make this a required input?


#265

Hi there @seanhoots , just having a questionment about last update

Finally can block dates on date picker from a list of dates so if my list is 1,2,5 i will be able to see 3,4,6,7,etc

But what about if my list of dates is the one that I would like to allow ? For exemple a list of availabilities … If my list of allowed dates is 3,4,6,7 i should see this dates and I should see 1,2,5 as crossed off dates.

How can I solve?

Thank you in advance