This commit is contained in:
@ -490,10 +490,13 @@ function qdb_dev_build_answers_for_questionnaire(PDO $pdo, string $qnID, int $va
|
||||
break;
|
||||
|
||||
case 'date_spinner':
|
||||
$year = 2018 + ($v % 6);
|
||||
$precision = $config['precision'] ?? 'full';
|
||||
$dateRange = ($config['dateRange'] ?? 'past') === 'future' ? 'future' : 'past';
|
||||
$year = $dateRange === 'future'
|
||||
? ((int)date('Y') + ($v % 5))
|
||||
: (2018 + ($v % 6));
|
||||
$month = 1 + ($v % 12);
|
||||
$day = 1 + ($v % 28);
|
||||
$precision = $config['precision'] ?? 'full';
|
||||
$dateValue = match ($precision) {
|
||||
'year' => sprintf('%04d', $year),
|
||||
'year_month' => sprintf('%04d-%02d', $year, $month),
|
||||
|
||||
Reference in New Issue
Block a user