Welcome, Guest
Username: Password: Remember me

TOPIC: Unusual problem with date field in 1.91

Unusual problem with date field in 1.91 2 years 6 months ago #66662

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
Over the weekend, I updated our production server from LimeSurvey 1.87 to 1.91.

Prior to the update, I was able to work out issues on a test PC. These included the different manner in which LimeSurvey 1.91 handles masked answers, etc.

As you might have guessed, I received an e-mail from one of our field people this morning, indicating that there was one issue I had not considered. To go with one of our surveys, I created a php script that allows a field person to select from an ever-changing list of clients (along with other pertinent information related to the client), then select a command to send the field person to a LimeSurvey survey that pre-fills the client's name, etc. Everything still works except for the date field.

I have a drop-down date question in the LimeSurvey survey, in mm-dd-yyyy order. The date of birth for the client apparently no longer populates that answer from the URL created in my PHP script.

Please advise.

tfj
The administrator has disabled public write access.

Re: Unusual problem with date field in 1.91 2 years 6 months ago #66669

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3813
  • Thank you received: 683
  • Karma: 327
We would need more details about the script(s) and perhaps a sample survey to help.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Unusual problem with date field in 1.91 2 years 6 months ago #66706

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5275
  • Thank you received: 289
  • Karma: 246
You can provide a simple sample survey for testing and give us some more details on how you try to populate the date question?

Also have a look at the survey settings where you can define the date format.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Unusual problem with date field in 1.91 2 years 6 months ago #66742

  • tfj
  • tfj's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 80
  • Thank you received: 6
  • Karma: 5
tpartner and Mazi:

Many thanks for your quick offers to help. I'm sorry I couldn't get back to you earlier -- there were a handful of issues related to the upgrade from 1.87 to 1.91 that I had to deal with.

I figured that by the time I made up a sample survey, etc., for you to look at, I could keep working at a solution through trial-and-error. After several attempts, mostly due to my not knowing PHP as well as SQL scripts, I finally figured out a solution to the problem.

Our field users want to see dates in mm-dd-yyyy format. In my PHP code, they click on a link beside a client's name from a table and it populates a LimeSurvey survey with the appropriate data. With 1.87, everything was working. With 1.91, however, the date of birth would not populate the dropdown date boxes.

For some reason, I had to populate the date of birth dropdown boxes in 1.87 with the date formatted as "mm-dd-yyyy," even though mySQL wants the date as "yyyy-mm-dd." In 1.91, I had to feed the survey with the date in "yyyy-dd-mm," even though the survey is set for "mm-dd-yyyy." Because of this switch, I had to figure out the PHP code so that the date of birth would show on the initial table as "mm-dd-yyyy" but would populate LimeSurvey as "yyyy-dd-mm." To do this, I had to use the PHP date function, but with a strange twist: I had to put it in as date('Y-d-m', strtotime . . .) instead of date('Y-m-d' . . .).

For some reason, given the above, all seems to be working now. Maybe my experience will help someone else.

Thanks again for the offers to help.

tfj
Last Edit: 2 years 6 months ago by tfj.
The administrator has disabled public write access.

Re: Unusual problem with date field in 1.91 2 years 6 months ago #66777

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5275
  • Thank you received: 289
  • Karma: 246
Thanks for your feedback!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.107 seconds
Donation Image