Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Date/Time AM/PM issues

  • MelThibs
  • MelThibs's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 months 4 weeks ago - 8 months 4 weeks ago #245429 by MelThibs
Date/Time AM/PM issues was created by MelThibs
Please help us help you and fill where relevant: 
Your LimeSurvey version: 3.28.52
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hello,

I have a date/time question with format dd-mm-yyyy HH:MM A
The questionnaire has two languages (French and English).

Whenever I try to select a PM time after 12 (ex: 12-08-2023 14:30 PM)
I get an error message and cannot move to the next page: "Date 12-08-2023 14:30 PM is invalid, please review your answer."

I'm unsure where the issue is coming from? Thanks in advance for the help.

I've changed the code so that certain dates cannot be chosen:
Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    // Disable specific days
    $('#answer{SGQ}_datetimepicker').data('DateTimePicker').disabledDates(['05-08-2023','09-08-2023', '25-08-2023', '26-08-2023', '27-08-2023', '28-08-2023', '02-10-2023', '24-12-2023', '25-12-2023']);
})
</script>
Last edit: 8 months 4 weeks ago by MelThibs. Reason: code format issue

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 months 4 weeks ago - 8 months 4 weeks ago #245433 by Joffm
Replied by Joffm on topic Date/Time AM/PM issues
Hi,

Of course "14:30 PM" is invald; should be "2:30 PM"
Your error is the H
H is defined as 
  • H - 24-hour format of an hour (00 to 23)
So, if you use the 24-hour format, you can't use  AM/PM at the same time

Use the 12-hour format "h:M A" and everything is fine.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 8 months 4 weeks ago by Joffm.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose