Page 1 of 1

date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 8:56 am
by Terry Gilliver

I have an input component of type 'date'. On the appery browser using chrome it gives a date picker. On my old android 2.3 it renders as a normal text field. I understand this as the internal browser probably is not html5 compliant. On my tablet running android 4.2.2, it shows a blank field, not even showing the place holder text, and pops up the on screen keyboard to fill in the field. Should it not have some kind of date picker?

If this is a html5 compliance problem, is there another way to show a date picker?


date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 12:22 pm
by Kateryna Grynko

Hi Terry,

Have you tried a Datepicker component?
http://devcenter.appery.io/documentat...


date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 2:23 pm
by Terry Gilliver

yes, that's what I needed. Is it possible to configure the min and max dates in javascript? Also I can't access the date value with Appery('date_input').val() anymore, how do I access this?


date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 3:38 pm
by Terry Gilliver

I have tried:

codevar date = Appery('date_input').datepicker('getDate');/code

thinking you were using the standard jQuery Mobile datepicker, but this gives me a console error:

Uncaught TypeError: undefined is not a function

I tried the following in Page Show event:

codevar today = new Date();
Appery('date_input').datepicker({minDate: today});
Appery('date_input').datepicker({maxDate: '+1w'});/code

This also gave console error


date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 4:23 pm
by Evgene Karachevtsev

Terry,

  1. You can set min and max dates in the right column - "PROPERTIES"
  2. To get selected date please use method preApperyio("mobiledatepicker_17").getAttr('defaultDateValue') /pre
    where mobiledatepicker_17 is you datepicker component name

date fields have unusual rendering on some devices

Posted: Wed Sep 17, 2014 6:26 pm
by Terry Gilliver

That works. However I want to set the date range from today to + 1week. which is why I need to do it in Javascript


date fields have unusual rendering on some devices

Posted: Thu Sep 18, 2014 7:57 am
by Maryna Brodina

Hello!

You can set min and max dates this way:preApperyio("mobiledatepicker_30").datepicker_dataPickerOptions.maxDate = "+1M +10D";/prepreApperyio("mobiledatepicker_30").datepicker_dataPickerOptions.minDate = -20;/prewhere mobiledatepicker_30 is your datepicker's name property


date fields have unusual rendering on some devices

Posted: Thu Sep 18, 2014 11:33 am
by Terry Gilliver

That works great, Thanks Maryna


date fields have unusual rendering on some devices

Posted: Wed Jan 28, 2015 12:48 am
by Aeneas McBurney

Hi,

I want to set the date of a input component with a date value today in code but have so far been unsuccessful. My code is

var datefrom = new Date()
Appery('invDateTo').attr('value',datefrom);

I have also tried
Appery('invDateTo').val(datefrom);

I do not what to use the datepicker component.

Can you please help?

Thanks,
Aeneas


date fields have unusual rendering on some devices

Posted: Fri Jan 30, 2015 9:33 pm
by Alena Prykhodko

Hello,

Works well for us: http://gyazo.com/aba2d9189a744060cb79... - simple date object inside
http://gyazo.com/236c31f04a49aad21962... - with a extra variable
http://gyazo.com/60382ef16006fcb8151d... - even Appery instead Apperyio works

1) Do you have errors in your code?
2) Do you have any other errors in console, before evaluating the code
3) When do you call your JavaScript ? It should be on Page Show, not on Load