Time question (Date question-like) is not working

More
4 years 5 months ago #86975 by amritdeep
I am using Time question (Date question-like) to submit the time
The code mentioned in workaround is not working.
I am using the following code in source code

Time question

<script src="/upload/surveys/{SID}/jquery-ui-timepicker-addon.js"></script>

<script>
$(document).ready(function(){

$('#answer{SGQ}').timepicker({
timeText: 'Time', //here translation
hourText: 'hour', //here translation
minuteText: 'minute', //here translation
closeText: 'Done' //here translation
});

$('#answer{SGQ}').attr('readonly', 'readonly');

$( "<style>"
+".ui-widget-header, .ui-datepicker-current { display:none; }"
+".ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }"
+".ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }"
+" }"
+"</style>").appendTo( "head" );

});
</script>


and Question type is : short free text.

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #86983 by floccs
Download the file at http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js and upload it to your survey.
Notice that the workaround has been tested only under Limesurvey 1.92+
Last Edit: 4 years 5 months ago by floccs.

Please Log in to join the conversation.

More
4 years 5 months ago #87049 by amritdeep
The link trentrichardson.com/examples/timepicker/...-timepicker-addon.js is not working.
it shows


Forbidden

You don't have permission to access /examples/timepicker/jquery-ui-timepicker-addon.js on this server.

Please Log in to join the conversation.

More
4 years 5 months ago #87064 by tpartner
Have a look at Mobiscroll - Demo.mobiscroll.com/#Demo=datetime&mode=clickpick . I've tested it successfuly on both PCs and iPads.

Cheers,
Tony Partner

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

Please Log in to join the conversation.

More
4 years 5 months ago - 4 years 5 months ago #87069 by floccs
Please, retry (no copy/paste the link, just click). Here it's working
Last Edit: 4 years 5 months ago by floccs.

Please Log in to join the conversation.

More
4 years 5 months ago #87149 by amritdeep
Now link is working. where i have to place this .js file ???

Please Log in to join the conversation.

More
4 years 5 months ago #87150 by DenisChenu

tpartner wrote: Have a look at Mobiscroll - Demo.mobiscroll.com/#Demo=datetime&mode=clickpick . I've tested it successfuly on both PCs and iPads.

Hello,

I really think we have to:
- Use input type="date" or input type="time" for date/time question type.
- Use js only if browser don't understand type="date/time" input, and DON'T sue js if browser understand input type.

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 5 months ago #87189 by amritdeep
Am sorry to say but i didn't understand how to use input type "time"

Please Log in to join the conversation.

More
4 years 5 months ago #87193 by DenisChenu

amritdeep wrote: Am sorry to say but i didn't understand how to use input type "time"

Sorry, it's a a developer comment. It's for LS 2.0.

Here, with 1.92, you have to use some js workaround.

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 5 months ago #87194 by amritdeep
I am using Time question (Date question-like) workaround. Where i have to place trentrichardson.com/examples/timepicker/...-timepicker-addon.js file in my survey.

Please Log in to join the conversation.