Commit 109e30b6 authored by Alexandre Goldstein's avatar Alexandre Goldstein
Browse files

fix date + time on main screen

parent b27bec42
Pipeline #12365 failed with stages
in 46 seconds
......@@ -106,13 +106,13 @@
<?merge .type.ifeq('date') ?>
<div class="form-group col-md-12">
<label class="col-md-3 control-label text-primary"><small><?merge .label ?></small></label>
<?merge .name.ifeq('datetime') ?>
<?merge .format.ifeq('datetime') ?>
<div class="input-group input-group-sm input-daterange col-md-4">
<input type="text" data-range='start' class="advancedSearchField form-control input-sm dateTimePicker col-md-6 descriptionInput" name="[?merge .name ?]" />
<span class="input-group-addon xsmall"><i class=" fa fa-arrow-right"></i></span>
<input type="text" data-range='end' class="advancedSearchField form-control input-sm dateTimePicker col-md-6 descriptionInput" name="[?merge .name ?]" />
</div>
<?merge .name.ifne('datetime') ?>
<?merge .format.ifne('datetime') ?>
<div class="input-group input-group-sm input-daterange col-md-4">
<input type="text" data-range='start' class="advancedSearchField form-control input-sm datePicker col-md-6 descriptionInput" name="[?merge .name ?]" />
<span class="input-group-addon xsmall"><i class=" fa fa-arrow-right"></i></span>
......@@ -324,6 +324,7 @@ FulltextSearchForm = {
case 'text':
if (value !== '') {
if ($(this).hasClass('datePicker')) {
var operation = ($(this).data('range') == 'start') ? ">=" : "<=";
value = name + operation + "'" + $(this).data('datepicker').getFormattedDate('yyyy-mm-dd') + "'";
......
......@@ -40,7 +40,7 @@
<select class="form-control" name="type" id="helperSelect">
<option value=""></option>
<?merge descriptionScheme?>
<option type="[?merge .type ?]" externalRef="[?merge .ref.bool()?]" data-enumName="[?merge .enumNames.json()?]" data-enumeration="[?merge .enumeration.json() ?]" helperName="[?merge .name ?]" value="[?merge .label ?]"><?merge .label ?></option>
<option type="[?merge .type ?]" format="[?merge .format ?]" externalRef="[?merge .ref.bool()?]" data-enumName="[?merge .enumNames.json()?]" data-enumeration="[?merge .enumeration.json() ?]" helperName="[?merge .name ?]" value="[?merge .label ?]"><?merge .label ?></option>
</select>
</td>
<td>
......@@ -191,11 +191,17 @@
var helperText = $("#helperSelect :selected").text();
var helperName = helper.attr("helperName");
var helperType = helper.attr('type');
var test = helper.attr('format');
if (helperText) {
var row = $('<li/>').addClass('helper').appendTo($("#helperList"));
var selectedHelperType = $('<li/>').addClass("col-sm-3 padding-5 align-right").appendTo(row);
$('#selectedHelper').clone().removeClass('hide').html(helperText).appendTo(selectedHelperType).prev().remove();
if (test === "datetime") {
helperType = test;
}
switch (helperType) {
case 'array':
var helperInput = $('<li/>').addClass("helperContent col-sm-8 padding-5").appendTo(row);
......@@ -243,12 +249,22 @@
break;
case 'date':
console.log('date toto');
var helperMin = $('<li/>').addClass("startDate helperContent col-sm-4 padding-5").appendTo(row);
var helperMax = $('<li/>').addClass("endDate helperContent col-sm-4 padding-5").appendTo(row);
$('#helperValueMin').clone().attr('type','date').attr('data-range','start').attr('name', helperName).appendTo(helperMin).prev().remove();
$('#helperValueMax').clone().attr('type','date').attr('data-range','end').attr('name', helperName).appendTo(helperMax).prev().remove();
break;
case 'datetime':
//TODO JS to render date + time
var helperMin = $('<li/>').addClass("startDate helperContent col-sm-4 padding-5").appendTo(row);
var helperMax = $('<li/>').addClass("endDate helperContent col-sm-4 padding-5").appendTo(row);
$('#helperValueMin').clone().attr('type','datetime').attr('data-range','start').attr('name', helperName).appendTo(helperMin).prev().remove();
$('#helperValueMax').clone().attr('type','datetime').attr('data-range','end').attr('name', helperName).appendTo(helperMax).prev().remove();
break;
case 'boolean':
var helperMin = $('<li/>').addClass("helperContent col-sm-8 padding-5").appendTo(row);
var helperCheckbox = $('#helperToggle').clone().attr('type','checkbox').attr('name', helperName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment