-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jqueryDayField is broken #1744
Comments
Can you link the Hackage documentation of the function (with the package version you are using)? Also, can you post the jQuery / jQuery CSS versions you're using? |
https://www.stackage.org/haddock/lts-18.20/yesod-form-1.7.0/Yesod-Form-Jquery.html#v:jqueryDayField
|
Just curious, what looks weird about them exactly? |
there's no |
This is a URL with an implicit or relative protocol. It just means it will pick the same protocol as the page the script is being called from. |
The generated HTML should be fine but the generated JS code to initialize the date picker may not work anymore. Maybe jQuery or jQuery UI changed the API. Does the JS console in the browser show any exceptions on page load? Maybe you find the bug in this piece of code: toWidget [julius|
$(function(){
var i = document.getElementById("#{rawJS theId}");
if (i.type != "date") {
$(i).datepicker({
dateFormat:'yy-mm-dd',
changeMonth:#{jsBool $ jdsChangeMonth jds},
changeYear:#{jsBool $ jdsChangeYear jds},
numberOfMonths:#{rawJS $ mos $ jdsNumberOfMonths jds},
yearRange:#{toJSON $ jdsYearRange jds}
});
}
});
|] |
nope, there aren't any errors, but in the code the condition |
I don't know how Indeed, the JS has only effect on the date picker field which has input type text, i.e. EDIT: Sorry, I confused the lines, actually peng changed this line in 2014. Michael only changed the type signature. |
I don't remember the details, sorry. |
So, apparently, there is only one "jQuery date field": https://jqueryui.com/datepicker/ I see no reason why My suggestion is to make them both acting same. For this, they must both be type text (which conforms to jQuery Datepicker documentation). (i18n is still a problem... nowadays I would always prefer the native date pickers.) |
in https://www.yesodweb.com/book/forms#forms_synopsis jqueryDayField is a plain
<input type=date>
that allows any rangeThe text was updated successfully, but these errors were encountered: