- Posts: 169
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
has ls date range question?
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
8 years 11 months ago - 8 years 11 months ago #120065
by iscar
has ls date range question? was created by iscar
Attachments:
Last edit: 8 years 11 months ago by iscar.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13633
- Thank you received: 2491
8 years 11 months ago #120068
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic has ls date range question?
Hi,
No actually ls core don't have range question type. You must use own javascript.
Denis
No actually ls core don't have range question type. You must use own javascript.
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 , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
8 years 11 months ago #120080
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic has ls date range question?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120082
by iscar
Replied by iscar on topic has ls date range question?
the difficulty is have no idea about the ls data storage predefined variables.
suppose i can use js, how to combine the js and ls core.
and, this is date range, and can set the date level.
suppose i can use js, how to combine the js and ls core.
and, this is date range, and can set the date level.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
8 years 11 months ago #120083
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic has ls date range question?
For date ranges, how about this -
longbill.github.io/jquery-date-range-picker/
You can apply it to a short-text question something like this (after including necessary files).
You can apply it to a short-text question something like this (after including necessary files).
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID} input[type="text"]').dateRangePicker({ startOfWeek: 'monday', separator : ' ~ ', format: 'DD.MM.YYYY HH:mm', autoClose: false, time: { enabled: true } }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: iscar
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120084
by iscar
Replied by iscar on topic has ls date range question?
i think a date range should has 2 values, then lots of calculation can be used, i review other systems, for example, calculate 2 date range overlapp.
your first car, your sencond car, then we know the overlap of these 2 car.
actually, date range question is the time position, i think it's the essentail type question.
your first car, your sencond car, then we know the overlap of these 2 car.
actually, date range question is the time position, i think it's the essentail type question.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13633
- Thank you received: 2491
8 years 11 months ago #120087
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic has ls date range question?
Actually : for date range, think you can use 2 date question type with min/max set .
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120088
by iscar
Replied by iscar on topic has ls date range question?
i tried to use this method but partcipant feel not good,answer 2 questions but for 1 thing. it's terrible if ls has no subquestion.
i am learning Use two inputs from the reference site,i think date range should be a basic type question.
i am learning Use two inputs from the reference site,i think date range should be a basic type question.
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120112
by iscar
Replied by iscar on topic has ls date range question?
i tested it, good function like predefined range.
i think the best solution is use 2 date in one ls question, and use js combine 2 date with ~,then we can calculate.
i think the best solution is use 2 date in one ls question, and use js combine 2 date with ~,then we can calculate.
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120117
by iscar
Replied by iscar on topic has ls date range question?
hi tpartner,
did you test other js?
i tried a better one, trentrichardson.com/examples/timepicker/
but this one is not work with ls, i guess some js conflict?
did you test other js?
i tried a better one, trentrichardson.com/examples/timepicker/
but this one is not work with ls, i guess some js conflict?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
8 years 11 months ago - 8 years 11 months ago #120131
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic has ls date range question?
Well LimeSurvey already comes with that plugin - you just need to insert it.
Add something like this to the source of a multiple-short-text with 2 sub-questions:
Add something like this to the source of a multiple-short-text with 2 sub-questions:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify some elements var thisQuestion = $('#question{QID}'); var startDateTextBox = $('input.text:eq(0)', thisQuestion); var endDateTextBox = $('input.text:eq(1)', thisQuestion); var surveyRoot = location.pathname.split('index.php')[0]; // Define the timepicker function insertPicker() { $.timepicker.datetimeRange( startDateTextBox, endDateTextBox, { minInterval: (1000*60*60), // 1hr dateFormat: 'dd M yy', timeFormat: 'HH:mm', start: { }, // start picker options end: { } // end picker options } ); } // Insert the timepickers if (!$.isFunction($.fn.timepicker)) { $('head link[rel="stylesheet"]').last().after('<link rel="stylesheet" href="'+surveyRoot+'third_party/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.css" type="text/css" media="screen">'); $.getScript( surveyRoot+'third_party/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.js', function( data, textStatus, jqxhr ) { insertPicker(); }); } else { insertPicker(); } }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 8 years 11 months ago by tpartner.
The topic has been locked.
- iscar
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 169
- Thank you received: 0
8 years 11 months ago #120134
by iscar
Replied by iscar on topic has ls date range question?
Attachments:
The topic has been locked.