Francesco
Posts: 0
Joined: Thu Jan 10, 2013 8:45 am

saving datepicking selected data in local storage variable

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

saving datepicking selected data in local storage variable

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

Francesco
Posts: 0
Joined: Thu Jan 10, 2013 8:45 am

saving datepicking selected data in local storage variable

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

Francesco
Posts: 0
Joined: Thu Jan 10, 2013 8:45 am

saving datepicking selected data in local storage variable

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

saving datepicking selected data in local storage variable

Hello! Working on it. I'll update

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

saving datepicking selected data in local storage variable

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

saving datepicking selected data in local storage variable

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

Francesco
Posts: 0
Joined: Thu Jan 10, 2013 8:45 am

saving datepicking selected data in local storage variable

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????

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

saving datepicking selected data in local storage variable

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

Francesco
Posts: 0
Joined: Thu Jan 10, 2013 8:45 am

saving datepicking selected data in local storage variable

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

Return to “Issues”