Sunny
Posts: 0
Joined: Mon Apr 21, 2014 9:47 pm

Datepicker to display multiple dates

Is it possible to display Datepicker as a monthly calendar view (instead of clicking on it to open)

Also, can i highlight multiple dates with background css in that Datepicker ?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Datepicker to display multiple dates

Hi Sunny,

Everything that jQuery Datepicker Widget API is supported you can implement: http://api.jqueryui.com/datepicker/

Sunny
Posts: 0
Joined: Mon Apr 21, 2014 9:47 pm

Datepicker to display multiple dates

Thanks .. That helps !!

Peter LPunkt
Posts: 0
Joined: Mon Jan 13, 2014 3:07 pm

Datepicker to display multiple dates

Hi there,
i've read other threads about getting datepickervalues by js but some of them are a bit old and i'm not sure if some things have changed.

What i want to do is get the datepicker current date via js:
this is the jquery method var currentDate = $( ".selector" ).datepicker( "getDate" );

I tried this on page load:
var date = Appery("date").datepicker("getDate"); ("date" is the name of datepicker element)
alert(date); other things i tried: alert(date.val());
Testing wasn't successful, the page isnt displayed in the tester.

After that, i want to use the variable date as an extension for a localstoragevariable. So far this worked, when i use the builder to set a localstorage variable with date on valuechange for the datepickerelement and use this code to add the extension:

var sleep = Appery('msm_sleep'); //mobileselectmenu for the value
var date = localStorage.getItem('date'); //the date saved to localstorage
localStorage.setItem('sleepscore' +date, sleep.val()); //the key (with date added) and value.

Do you have an idea to complete this without setting the date with the builder but instead by js?
something like

var setdate = Appery("date").datepicker("getDate"); //get date
localstorage.setItem('date', setdate.val()); //store in localstorage
var sleep = Appery('msm_sleep'); //get value
var date = localStorage.getItem('date'); //get date
localStorage.setItem('sleepscore' +date, sleep.val()); //store key and value

What am i missing?
Cheers

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Datepicker to display multiple dates

Hello Peter,

Could you please try this code:
prevar setdate = Appery("date").attr("defaultDateValue");/pre

Peter LPunkt
Posts: 0
Joined: Mon Jan 13, 2014 3:07 pm

Datepicker to display multiple dates

Hi this worked.
For anyone interested, this the code i used successfully:
pre
var setdate = Appery("date").attr("defaultDateValue"); //get defaultdate

//alert(setdate); to check if successful

//localStorage.setItem('date', setdate); //key:date, value:15/07/2014 (or whatever date is) if you want to save date

var sleep = Appery('msm_sleep'); //mobiledropdown component value

localStorage.setItem('sleepscore' + setdate, sleep.val()); // save name +date (in this case sleepscore15/07/2014) and value.
/pre

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Datepicker to display multiple dates

Peter,

Thank you for the update, glad it works!

Poll David
Posts: 0
Joined: Sat Jan 24, 2015 5:22 am

Datepicker to display multiple dates

Hi thanks for the reply, I am still thinking on how to actually do this, but can I have an unrelated question?

I have a DatePicker component, and I want to get the value using javascript..

I am doing

codevar startdate = Apperyio('start_date').val();
var enddate = Apperyio('end_date').text();
var startdate1 = Apperyio("start_date");

alert(startdate);
alert(enddate);
alert(enddate)1;/code where start_date and end_date are datepicker names.

but no value is showing up.. But var startdate1 = Apperyio("start_date"); shows [object Object] on alert

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Datepicker to display multiple dates

Hello!

Please try this
prevar startdate = Apperyio('start_date').getOptions().defaultDate;/pre
Please make the same for other.

Poll David
Posts: 0
Joined: Sat Jan 24, 2015 5:22 am

Datepicker to display multiple dates

Thanks, I already have the solution. Sorry for the trouble.. I have another question if you do not mind..

I have this list and I want to concatenate the start_date and event_name from collection to show as title on the list menu..

Can you please help? Image

Return to “Issues”