Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

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

Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77895

  • steinj
  • steinjs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 7
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77921

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5325
  • Dank erhalten: 296
  • Karma: 249
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)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77939

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77964

  • steinj
  • steinjs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 7
  • Karma: 0
Mazi,

This worked perfectly and was easy to do. Thanks very much for your help.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77965

  • steinj
  • steinjs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 7
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 2 Jahre 5 Monate her #77968

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6334
  • Dank erhalten: 818
  • Karma: 243
steinj schrieb:
I appreciate the links and level of detail.
One link more:
docs.limesurvey.org/tiki-index.php?page=...ime+using+Javascript

;)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding 00:00:00 to a date field... 1 Jahr 1 Monat her #98588

  • elitim
  • elitims Avatar
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.138 Sekunden
Donation Image