has ls date range question?

Mehr
2 Jahre 11 Monate her - 2 Jahre 11 Monate her #120065 von iscar
iscar erstellte das Thema has ls date range question?
it's a basic type question in other system,you can set the tick as year or month or day,even sencond. like below





has ls date range question?
Anhang:
Letzte Änderung: 2 Jahre 11 Monate her von iscar.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120068 von DenisChenu
DenisChenu antwortete auf das Thema: has ls date range question?
Hi,

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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120080 von tpartner
tpartner antwortete auf das Thema: has ls date range question?

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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120082 von iscar
iscar antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120083 von tpartner
tpartner antwortete auf das Thema: 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).

<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.
Folgende Benutzer bedankten sich: iscar

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120084 von iscar
iscar antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120087 von DenisChenu
DenisChenu antwortete auf das Thema: 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120088 von iscar
iscar antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120112 von iscar
iscar antwortete auf das Thema: 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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120117 von iscar
iscar antwortete auf das Thema: 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?

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her - 2 Jahre 11 Monate her #120131 von tpartner
tpartner antwortete auf das Thema: 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:

<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>

Dateianhang:

Dateiname: limesurvey...8984.lss
Dateigröße:15 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Anhang:
Letzte Änderung: 2 Jahre 11 Monate her von tpartner.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120134 von iscar
iscar antwortete auf das Thema: has ls date range question?
i tested it, really good and no conflict.just not support other language, doesnot matter.
if i use the start-end in array type text question, how to revise the script accordingly?

Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120232 von tpartner
tpartner antwortete auf das Thema: has ls date range question?
This script will handle text inputs in an array-texts type question:

<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function() {	
 
		// Identify some elements
		var thisQuestion = $('#question{QID}');
 
		var surveyRoot = location.pathname.split('index.php')[0];
 
		// Define the timepicker		
		function insertPickers() {
			$('tr.subquestion-list', thisQuestion).each(function(i) {
				var startDateTextBox = $('input[type="text"]:eq(0)', this);
				var endDateTextBox = $('input[type="text"]:eq(1)', this);
 
				$.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 ) {
				insertPickers();
			});
		}
		else {	
			insertPickers();
		}
	});
</script>

Sample survey attached.

Dateianhang:

Dateiname: limesurvey...6224.lss
Dateigröße:16 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Anhang:
Folgende Benutzer bedankten sich: Ben_V

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120234 von Ben_V
Ben_V antwortete auf das Thema: has ls date range question?
Hi Tony,
very useful for users looking for a check-in / check-out "booking" question type ;)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 11 Monate her #120236 von iscar
iscar antwortete auf das Thema: has ls date range question?
thanks for tpartner replay.
the problem is js has no date calculation function then i need to turn the date into timestamp.
tried altfield option,how to use @ to record the date as timestamp and let input display the date?

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha