View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 08849 | Bug reports | Survey editing | public | 2014-03-13 14:59 | 2014-03-13 18:50 |
| Reporter | tpartner | Assigned To | mfaber | ||
| Priority | normal | Severity | partial_block | ||
| Status | closed | Resolution | not fixable | ||
| Product Version | 2.05+ | ||||
| Summary | 08849: Setting custom options for datepicker no longer works | ||||
| Description | You can no longer use JavaScript to dynamically set the datepicker options (minDate, maxDate, etc). In previous versions this was possible by placing JS in the question source or template.js. | ||||
| Steps To Reproduce | Create a date question and add the following script to the question source. This script should set the maxDate to todays date. <script type="text/javascript" charset="utf-8"> | ||||
| Additional Information | This is caused by the fact that these options are now set by the setPickerOptions() function every time the datepicker is shown. See https://github.com/LimeSurvey/LimeSurvey/commit/15d5587c939b17d641088ba374cd286e141ac48d. | ||||
| Tags | No tags attached. | ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | fee21b2bb989967b363485a7085d | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | All | ||||
| Database type & version | N/A | ||||
| Server OS (if known) | Win 32 | ||||
| Webserver software & version (if known) | Apache/2.4.3 (Win32) | ||||
| PHP Version | 5.4.7 | ||||
| Git branch / Pull Request URL | |||||
|
Hi mfaber, Why can't these options be set at initialization as in the past? The problem here is that a script like above does actually work but then is overridden the next time the picker is displayed. |
|
|
The datepicker needs to react dynamically to changes on the pages. Does that make sense? Apart from that, why use manual scripts and not the field in LS? |
|
|
I am concerned with backwards compatibility. The 2.05 comfort update has only been available for a couple of weeks and I am already getting clients complaining that their date questions no longer work. |
|
|
I see the problem....on the other hand I think it's not feasible to guarantee users that custom JS which changes under-the-hood LS behaviour to work in future versions. This would mean we could never change anything structural. And in this case there is a new feature which helps the same users that had to come up with custom js solutions before. I'm open for suggestions if there's a way to make both work at the same time but I would not like to sacrifice this feature for backward compatibility of workarounds. |
|
|
Err...I don't see these as "custom JS" or "workarounds", I see them as a perfectly valid extension of the included jQuery UI Datepicker. That is, after all, why there are settable options in the API. Maybe we should add to the documentation that the jQuery UI options are no longer available. |
|
|
For my colleagues (or other non-IT folks), pressing the "source button" and then entering something with a whole lot of brackets, braces and other funny stuff would be very hacky, geeky or custom. All a matter of perspective, I guess ;). I have added a note in the manual (listed, as a matter of fact, under "Workarounds" http://manual.limesurvey.org/Workarounds:_Question_design,_layout_and_templating#Minimum_or_Maximum_Date_in_Datepicker). |
|
|
Thank you. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-03-13 14:59 | tpartner | New Issue | |
| 2014-03-13 14:59 | tpartner | Status | new => assigned |
| 2014-03-13 14:59 | tpartner | Assigned To | => mfaber |
| 2014-03-13 15:03 | tpartner | Note Added: 29239 | |
| 2014-03-13 16:28 | mfaber | Note Added: 29243 | |
| 2014-03-13 16:52 | tpartner | Note Added: 29244 | |
| 2014-03-13 17:07 | mfaber | Note Added: 29245 | |
| 2014-03-13 17:25 | tpartner | Note Added: 29247 | |
| 2014-03-13 18:14 | mfaber | Note Added: 29249 | |
| 2014-03-13 18:28 | tpartner | Note Added: 29250 | |
| 2014-03-13 18:50 | mfaber | Status | assigned => closed |
| 2014-03-13 18:50 | mfaber | Resolution | open => not fixable |
| 2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |