Page 1 of 2

saving datepicking selected data in local storage variable

Posted: Thu Jan 10, 2013 12:31 pm
by Francesco

I would like to set the default date to current date and
save the current displayed or selected date in a local storage variable.
i tried to run a javascrip: alert(Tiggzi("datepickerComponent_name").val()); on value change event for the datepickerComponent, but when i test the app nothing happen
How should i do.


saving datepicking selected data in local storage variable

Posted: Thu Jan 10, 2013 3:14 pm
by Kateryna Grynko

Hello,

To read date run JavaScript:
codeTiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate;/code

To change DatePicker date run code:
codeTiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate = '10/10/2012';
Tiggzi('mobiledatepicker1_2').initializeDataPicker();/code


saving datepicking selected data in local storage variable

Posted: Fri Jan 11, 2013 4:22 pm
by Francesco

hello again, i tried to run Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate = '10/10/2012'; on a onload event in the screen and nothing happen; the default date remain the same of the component form
then I tried to run alert(Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate); on value chang of the mobiledatepicker1_2 component and dont get any alert.

i would like to save the date in a local storage variabile to use it in some rest services


saving datepicking selected data in local storage variable

Posted: Fri Jan 11, 2013 5:01 pm
by Francesco

i tried to run the code Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate = '10/10/2012';
Tiggzi('mobiledatepicker1_2').initializeDataPicker();
on on-load event on the screen and when i tested the app the first date showed in the input is the same set in the component form (01/11/2013) but when i click on the small botton of the datepicker the date change to that one of the javascript 10/10/2012.
is there a way to hide the default date in the datepicker component?

then i run alert(Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate); on a value-change event of the datepicker componentbut no alert are shown.

anyway i would like to save the selected data to use it as input in some rest service is there a way to do it?


saving datepicking selected data in local storage variable

Posted: Fri Jan 11, 2013 5:06 pm
by Maryna Brodina

Hello! Working on it. I'll update


saving datepicking selected data in local storage variable

Posted: Fri Jan 11, 2013 6:49 pm
by Maryna Brodina

Change value event on DatePicker component doesn't work - it's a bug. We are looking for workaround for you.


saving datepicking selected data in local storage variable

Posted: Fri Jan 11, 2013 7:17 pm
by Maryna Brodina

As Change value event doesn't work you can change data on button click for example

Try this script to update first date showed

Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate = '08/10/2010';
Tiggzi('mobiledatepicker1_2').initializeDataPicker();

mobiledatepicker1_2 - DatePicker component name

localStorage.setItem('timeX', $('[dsid="mobiledatepicker1_2"] input').val());

timeX - local variable name


saving datepicking selected data in local storage variable

Posted: Mon Jan 14, 2013 10:35 am
by Francesco

hello, i'm still having some problem with datepicker. even if i run the java script Tiggzi('mobiledatepicker1_2').datepicker_dataPickerOptions.defaultDate = '08/10/2010';
Tiggzi('mobiledatepicker1_2').initializeDataPicker(); on load event the date showed on datepicker label is not the one I expected, but the default date set when i add the component.

i would like to try a workaround using an input component with type time.
it looks ok but when I select the date in the input box it is written like aaaa-mm-dd.

is there any possible way to write the date in the dd-mm-aaaa format???
is it possible to show the ccurrent date even if it is not selected any date????


saving datepicking selected data in local storage variable

Posted: Mon Jan 14, 2013 11:09 am
by Maryna Brodina

Hello! Not sure why it doesn't work for you. Here is an app example

http://project.tiggzi.com/mobile-fram...

On load event I used this JS

codeTiggzi('mobiledatepicker1_10').datepicker_dataPickerOptions.defaultDate = '08/10/2010';
Tiggzi('mobiledatepicker1_10').initializeDataPicker();/code

Tested with Chrome and Firefox. Please clear the cache and try again.

I'll update about your two last questions


saving datepicking selected data in local storage variable

Posted: Mon Jan 14, 2013 1:49 pm
by Francesco

did you find any solution to my two questions???

1 to write the date in the input component (type date) in the format dd-mm-aaaa;
2 to write the current date in the same input component on screen load