Check out the LimeSurvey source code on GitHub!

Adding 00:00:00 to a date field...

More
4 years 10 months ago #77895 by steinj
Hi Everyone:

I have an application that requires inputting half a dozen dates in a survey-- this is easily done within LimeSurvey, I know. However, these date fields require that the date be followed by a space and then 00:00:00 Note that I don't need an actual time field but actually just need 00:00:00 Is there a way to do this while still allowing use of the calendar or drop-downs for selecting the date. I would hate to lose that capability. I also realize that the 00:00:00 could be appended at the end of the survey using MySQL but my analysts are not MySQL WIZs so I would rather avoid this solution if possible.

The ideal solution would be that the 00:00:00 be added automatically to the date which is acquired through the question's little calendar or drop-down.

Thanks very much.

Please Log in to join the conversation.

More
4 years 10 months ago #77921 by Mazi
For tsting create a copy of your survey. after activation use a tool like phpmyadmin and change the type of the column which stores the date question to DATETIME. The column can be identified by the SGQA ID: docs.limesurvey.org/SGQA+identifier&stru...#General_Description

This should work but I didn't test. Please give it a try and report back.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
4 years 10 months ago #77939 by DenisChenu
Hello,

Maybe more easy, wthout changing database etc ...

Use a short text box and add a jquery plugin DateTime picker.

Some example of DateTime picker plugin.
jonathonhill.net/2009-03-27/jquery-datetime-picker/
trentrichardson.com/examples/timepicker/

OR, because you need only DATE 00:00:00 and not a real time:
Use a multi short text (2 subquestion)
- First : with the picker
- Second with the answer with 00:00:00 in SQL format you need.

Use your own jquery option with datepicker:
- jqueryui.com/demos/datepicker/#alt-field to populate Second subquestion
- jqueryui.com/demos/datepicker/#date-formats for SQL date format
- jqueryui.com/demos/datepicker/#event-onSelect to add 00:00:00 at the second subquestion.

Need some jquery works but i think it's the good idea.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
4 years 10 months ago #77964 by steinj
Mazi,

This worked perfectly and was easy to do. Thanks very much for your help.

Please Log in to join the conversation.

More
4 years 10 months ago #77965 by steinj
Hi Denis,

Thanks very much for your help and suggestions. I'm going to try to figure out how to implement your modifications as I have a feeling I'm going to need this type of knowledge for some other "funny" fields that I need to collect. I appreciate the links and level of detail.

Please Log in to join the conversation.

More
4 years 10 months ago #77968 by DenisChenu

steinj wrote: I appreciate the links and level of detail.

One link more:
docs.limesurvey.org/tiki-index.php?page=...ime+using+Javascript

;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

  • elitim
  • elitim's Avatar
  • Visitor
  • Visitor
3 years 7 months ago #98588 by elitim
Hi..that' exactly what I'm trying to do..but it doens't work for me..I did put datepicker, but I don't know how to input the result in the survey :) Can you help ?? tks

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form