View Issue Details

This bug affects 1 person(s).
 14
IDProjectCategoryView StatusLast Update
13322Bug reportsOtherpublic2018-11-02 12:15
ReporterJamesHarrisHKI Assigned Tomarkusfluer 
PriorityhighSeverityminor 
Status closedResolutionfixed 
Product Version3.1.x 
Fixed in Version3.4.x 
Summary13322: DateTime picker opens partially or not at all
Description

To create a minimal, complete, verifiable example for this, I created a survey with two identical Date/Time questions. Both are set to use the format "dd/mm/yyyy HH:MM", so clicking the calendar button by each field should open a date-and-time picker.

When the survey is set to use certain themes, such as "fruity", clicking the second calendar button opens a date-and-time picker as expected, but clicking the first one only opens the date picker. Both questions use the exact same settings; they should have the same behavior.

When the survey uses other themes, such as "bootswatch" or "vanilla", no pickers will open at all. The browser's console shows this error: "uncaught exception: bootstrap-datetimepicker requires Moment.js to be loaded first", followed by "TypeError: jQuery(...).datetimepicker is not a function". Curiously, one of our people extended the "bootswatch" theme and got the partially-working behavior from the "fruity" theme, despite the extended theme only making a few color changes in CSS.

Here's my example, set to use "fruity": http://uksurveys.hkipop.com/index.php/114454?newtest=Y&lang=en We are using the most recent code from the master branch, commit cd7ead6.

Vanilla: No popups
Bootswatch: No popups
Fruity: 1.5 popups

Steps To Reproduce
  1. Create a new survey.
  2. Create a question group.
  3. Create a new question. Under "Question Type" on the right, select "Mask questions -> Date/Time (type code: D)". Under "Input -> Date/Time Format", type "dd/mm/yyyy HH:MM".
  4. Repeat step 3.
  5. Preview survey. Click "Next".
  6. Click the calendar button next to the first question. You get a calendar-style date picker.
  7. Click the calendar button next to the second question. You get a calendar-style date picker and also a time selector.
  8. Back in the admin panel for your test, go to Settings -> General Settings -> Template and change it from "fruity" to "bootswatch" or "vanilla". Click "Save".
  9. Repeat step 5.
  10. Click either of the calendar buttons. Nothing happens.
TagsNo tags attached.
Attached Files
Bug heat14
Complete LimeSurvey version number (& build)cd7ead6
I will donate to the project if issue is resolvedNo
BrowserFirefox and Chrome
Database type & version347
Server OS (if known)Windows Server 2008
Webserver software & version (if known)Apache/2.4.23 (Win64)
PHP Version7.0.9

Relationships

related to 14194 closedDenisChenu Datepicker not working with user template 

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2018-02-09 17:25

administrator   ~46374

Is this still an issue in the latest release version?
If yes, please attach the sample survey. Thank you.

JamesHarrisHKI

JamesHarrisHKI

2018-02-09 17:33

reporter   ~46376

Yes. Here is the sample survey: http://uksurveys.hkipop.com/index.php/114454?newtest=Y&lang=en

JamesHarrisHKI

JamesHarrisHKI

2018-02-09 17:35

reporter   ~46377

I have exported the survey as an .lsa file, attached. Is that what you need?

JamesHarrisHKI

JamesHarrisHKI

2018-02-12 21:47

reporter   ~46404

We've switched to limesurvey3.3.0+180209 and the bug still appears.

JamesHarrisHKI

JamesHarrisHKI

2018-02-21 17:53

reporter   ~46710

This bug report is for DateTime pickers, but we're seeing a related issue with Date pickers. Sometimes (but not always) the console will say "uncaught exception: bootstrap-datetimepicker requires Moment.js to be loaded first" and the Date picker will fail to open when clicked. Perhaps there's a race condition happening?

ollehar

ollehar

2018-03-01 16:28

administrator   ~46853

I tried to reproduce this on Linux without success. The date picker works fine. The picker works fine in your link, too. Can this issue be closed?

LouisGac

LouisGac

2018-03-05 10:23

developer   ~46890

Markus could you have a look to the moment.js loading problem?

markusfluer

markusfluer

2018-03-05 10:48

administrator   ~46891

To use the datetimepicker moment has to be loaded as a package in the theme.

LouisGac

LouisGac

2018-03-05 11:05

developer   ~46892

Reporter say: " Sometimes (but not always) the console will say "uncaught exception: bootstrap-datetimepicker requires Moment.js to be loaded first" and the Date picker will fail to open when clicked. "

could you check how the date picker's js and moment js are loaded?

JamesHarrisHKI

JamesHarrisHKI

2018-03-05 17:59

reporter   ~46904

After upgrading to LimeSurvey 3.4.3+180227, the moment.js loading problem no longer appears. On all themes, DatePickers and DateTimePickers will no longer fail to open. Thank you for the fix. :-)

We still have the issue that when placing two identical DateTimePickers in a survey, the first one will consistently produce a DatePicker instead. See attached screenshots, created from the same sample survey I linked above: http://uksurveys.hkipop.com/index.php/114454?newtest=Y&lang=en

DateTime-2.png (57,894 bytes)   
DateTime-2.png (57,894 bytes)   
DateTime-1.png (59,837 bytes)   
DateTime-1.png (59,837 bytes)   
LouisGac

LouisGac

2018-03-05 18:04

developer   ~46905

ok thank you for that feedback!
could you please open a new bug report for the double date time picker problem?

JamesHarrisHKI

JamesHarrisHKI

2018-03-05 18:06

reporter   ~46906

I have just noticed that DateTimePicker 1 has a small clock icon at the bottom that, when clicked, reveals the "time" side of the DateTimePicker. This is not clear enough, and it is not consistent. Please label the icon and/or cause the two identical DateTimePickers to function the same way.

JamesHarrisHKI

JamesHarrisHKI

2018-03-05 18:51

reporter   ~46911

@LouisGac New bug report, as requested: https://bugs.limesurvey.org/view.php?id=13450

JamesHarrisHKI

JamesHarrisHKI

2018-03-05 18:51

reporter   ~46912

You can close this issue now.

halliballi123

halliballi123

2018-10-29 15:45

reporter   ~49471

Ee still face this problem but only in Mozilla Firefox 63 (64-bit) and Firefox 60.3.0 esr (32-bit), IE is ok
We have currently version 3.14.11 running on our server.

here is the error from console window in Firefox
uncaught exception: bootstrap-datetimepicker requires Moment.js to be loaded first
TypeError: $.fn.datetimepicker is undefined[Weitere Informationen]

After reloading the page, I can click on the Icon and the Datepicker appears.

DenisChenu

DenisChenu

2018-10-29 18:37

developer   ~49474

@halliballi123 : since it close since 3.4.x : i think you can report a new issue.

Surely related to ajax-mode …

markusfluer

markusfluer

2018-10-30 10:49

administrator   ~49481

Are you using a self built theme?
Please add moment in the packages of your theme then.

halliballi123

halliballi123

2018-10-30 11:01

reporter   ~49482

You are right, I have a self built theme. That might cause the problem. but and where do I get this Moment.js?
Thank you

markusfluer

markusfluer

2018-10-30 11:10

administrator   ~49483

Last edited: 2018-10-30 11:11

moment is part of the general packages.
You can check the theme options and go to the advanced tab.
in the very last row with the label "Packages to load" should have this content:

{"add":["pjax","font-noto","moment"]}

you may leave out font-noto if you don't need it.

DenisChenu

DenisChenu

2018-10-30 12:07

developer   ~49485

moment is needed for expression ? No ?
If yes : must put in https://github.com/LimeSurvey/LimeSurvey/blob/3a7bbff279f2ae3fbf5278c73a4dbd6e427f00d4/application/config/packages.php#L33 (develop)

And if not : must create question_date package with this depend.

halliballi123

halliballi123

2018-10-30 12:08

reporter   ~49486

Ok, I found moment-with-locales.min.js and I added the file in config.xml.
But the error still shows up.

Do I have to add the file somehow different? for Ajax?

halliballi123

halliballi123

2018-10-30 12:12

reporter   ~49487

sorry, forget my last message (I sent it and your answers where already there)

Thank you Markus. That was the solution for my problem!!!

halliballi123

halliballi123

2018-10-30 12:24

reporter   ~49490

can I put that somehow into the config.xml?
Otherwise I have to add that configuration everytime I re-install that theme.

halliballi123

halliballi123

2018-10-30 12:31

reporter   ~49491

found it:

inside <engine> tag
add:
<packages>
<add>pjax</add>
<add>moment</add>
<add>font-noto</add>
</packages>

markusfluer

markusfluer

2018-11-02 12:15

administrator   ~49514

Ok Great.
I like it when a bug solves itself. :D

Issue History

Date Modified Username Field Change
2018-02-08 19:52 JamesHarrisHKI New Issue
2018-02-09 17:25 c_schmitz Assigned To => c_schmitz
2018-02-09 17:25 c_schmitz Status new => feedback
2018-02-09 17:25 c_schmitz Note Added: 46374
2018-02-09 17:33 JamesHarrisHKI Note Added: 46376
2018-02-09 17:33 JamesHarrisHKI Status feedback => assigned
2018-02-09 17:35 JamesHarrisHKI File Added: survey_archive_114454.lsa
2018-02-09 17:35 JamesHarrisHKI Note Added: 46377
2018-02-12 21:47 JamesHarrisHKI Note Added: 46404
2018-02-13 10:26 c_schmitz Assigned To c_schmitz => LouisGac
2018-02-13 10:26 c_schmitz Priority none => high
2018-02-21 17:53 JamesHarrisHKI Note Added: 46710
2018-03-01 16:28 ollehar Status assigned => feedback
2018-03-01 16:28 ollehar Note Added: 46853
2018-03-01 16:28 ollehar Assigned To LouisGac => ollehar
2018-03-05 10:23 LouisGac Assigned To ollehar => markusfluer
2018-03-05 10:23 LouisGac Note Added: 46890
2018-03-05 10:48 markusfluer Note Added: 46891
2018-03-05 11:05 LouisGac Note Added: 46892
2018-03-05 17:59 JamesHarrisHKI File Added: DateTime-2.png
2018-03-05 17:59 JamesHarrisHKI File Added: DateTime-1.png
2018-03-05 17:59 JamesHarrisHKI Note Added: 46904
2018-03-05 17:59 JamesHarrisHKI Status feedback => assigned
2018-03-05 18:04 LouisGac Note Added: 46905
2018-03-05 18:06 JamesHarrisHKI Note Added: 46906
2018-03-05 18:51 JamesHarrisHKI Note Added: 46911
2018-03-05 18:51 JamesHarrisHKI Note Added: 46912
2018-03-06 11:15 markusfluer Status assigned => closed
2018-03-06 11:15 markusfluer Resolution open => fixed
2018-03-06 11:15 markusfluer Fixed in Version => 3.4.x
2018-10-29 15:45 halliballi123 Note Added: 49471
2018-10-29 18:37 DenisChenu Note Added: 49474
2018-10-30 10:49 markusfluer Note Added: 49481
2018-10-30 11:01 halliballi123 Note Added: 49482
2018-10-30 11:10 markusfluer Note Added: 49483
2018-10-30 11:11 markusfluer Note Edited: 49483
2018-10-30 12:07 DenisChenu Note Added: 49485
2018-10-30 12:08 halliballi123 Note Added: 49486
2018-10-30 12:12 halliballi123 Note Added: 49487
2018-10-30 12:24 halliballi123 Note Added: 49490
2018-10-30 12:31 halliballi123 Note Added: 49491
2018-10-30 14:03 DenisChenu Relationship added related to 14194
2018-11-02 12:15 markusfluer Note Added: 49514