1.Is it possible to make the "clear" button on the datepicker to be available after I picked a date in both my inputs. After I done it, its impossible to clear the date.

<input name="fromDate" id="fromDate" type="date" min="" max="" />
<input name="untilDate" id="untilDate" type="date" min="" max="" data-dependent-validation='{"from": "fromDate", "prop": "required"}' />

If I picked one I dont want it be possible to post without the other one. That's why im using 'data-dependent-validation'. (I notice their wasn't any language suport on the "clear" button. At least not into swedish).

2.Is their any suport to open up a specific month? Got a own made calendar and want the picker to open up in the month that I choosen. And not todays date as default.

3.Will you include a date spinner as an option for the date picker? (good for mobiles).

OT: I notice on my iphone 4s that the "requierd" attribute was ignored on all off my inputs. Is that anything you noticed? Works as it should on my PC and windows 8 phone.

有帮助吗?

解决方案

  1. a) Make clear available: I think you shouldn't set it to required. Instead you could write something like this:

$('#fromDate').on('change', function(){ if(!$.prop(this, 'value'){ $('#untilDate').prop('value', ''); } });

Does this help?

b) clear locale Yeah, I know. I was very lazy here. It would be extreme nice, if you could compare english and swedish locale for me and do a PR with improved and more usable errormessages/locale settings

  1. Yes. There is the "startValue" option. See in action (afarkas.github.io/webshim/demos/demos/cfgs/input-date.html#startValue=2012-12-12&startView=2):

    input type="date" data-date='{"startValue": "2010-12-12"}' /

  2. a) Currently not. My mobile strategy is to leave input widgets native on mobile and only set replaceUI on desktop.

b) required not working on iOS. Which iOS version are you using? I'm not aware, but if it's iOS 5.1.1+, I will look into it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top