added support for date specifictiy
This commit is contained in:
@ -146,7 +146,16 @@ function configFormHTML(layout, config, prefix) {
|
||||
case 'date_spinner': {
|
||||
const notBefore = config.constraints?.notBefore || '';
|
||||
const notAfter = config.constraints?.notAfter || '';
|
||||
const precision = config.precision || 'full';
|
||||
html = `
|
||||
<div class="form-group">
|
||||
<label>Date precision</label>
|
||||
<select id="${prefix}_precision">
|
||||
<option value="full" ${precision === 'full' ? 'selected' : ''}>Year, month, and day</option>
|
||||
<option value="year_month" ${precision === 'year_month' ? 'selected' : ''}>Year and month</option>
|
||||
<option value="year" ${precision === 'year' ? 'selected' : ''}>Year only</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label>Not before (question key)</label>
|
||||
@ -257,6 +266,8 @@ function readConfigFromForm(layout, prefix) {
|
||||
};
|
||||
break;
|
||||
case 'date_spinner': {
|
||||
const prec = val('precision') || 'full';
|
||||
if (prec && prec !== 'full') config.precision = prec;
|
||||
const nb = val('notBefore');
|
||||
const na = val('notAfter');
|
||||
if (nb || na) {
|
||||
|
||||
Reference in New Issue
Block a user