diff --git a/css/icons.scss b/css/icons.scss index 4aa373b..114b94f 100644 --- a/css/icons.scss +++ b/css/icons.scss @@ -29,6 +29,8 @@ @include icon-black-white('answer-dropdown', 'forms', 1); @include icon-black-white('answer-short', 'forms', 1); @include icon-black-white('answer-long', 'forms', 1); +@include icon-black-white('answer-date', 'forms', 1); +@include icon-black-white('answer-datetime', 'forms', 1); @include icon-black-white('drag-handle', 'forms', 1); .icon-yes { diff --git a/img/answer-date.svg b/img/answer-date.svg new file mode 100644 index 0000000..354bd02 --- /dev/null +++ b/img/answer-date.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/img/answer-datetime.svg b/img/answer-datetime.svg new file mode 100644 index 0000000..6fd29ab --- /dev/null +++ b/img/answer-datetime.svg @@ -0,0 +1,4 @@ + + + + diff --git a/lib/Db/Question.php b/lib/Db/Question.php index 26549d0..16dbeb6 100644 --- a/lib/Db/Question.php +++ b/lib/Db/Question.php @@ -53,7 +53,9 @@ class Question extends Entity { 'long', 'multiple', 'multiple_unique', - 'dropdown' + 'dropdown', + 'date', + 'datetime', ]; public function __construct() { diff --git a/src/components/Questions/QuestionDate.vue b/src/components/Questions/QuestionDate.vue new file mode 100644 index 0000000..9f31e1f --- /dev/null +++ b/src/components/Questions/QuestionDate.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/components/Questions/QuestionDatetime.vue b/src/components/Questions/QuestionDatetime.vue new file mode 100644 index 0000000..9ab0b62 --- /dev/null +++ b/src/components/Questions/QuestionDatetime.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/src/models/AnswerTypes.js b/src/models/AnswerTypes.js index f8b4631..3d909af 100644 --- a/src/models/AnswerTypes.js +++ b/src/models/AnswerTypes.js @@ -24,6 +24,8 @@ import QuestionMultiple from '../components/Questions/QuestionMultiple' import QuestionDropdown from '../components/Questions/QuestionDropdown' import QuestionShort from '../components/Questions/QuestionShort' import QuestionLong from '../components/Questions/QuestionLong' +import QuestionDate from '../components/Questions/QuestionDate' +import QuestionDatetime from '../components/Questions/QuestionDatetime' /** * @typedef {Object} AnswerTypes @@ -105,4 +107,25 @@ export default { warningInvalid: t('forms', 'This question needs a title!'), }, + date: { + component: QuestionDate, + icon: 'icon-answer-date', + label: t('forms', 'Date'), + + titlePlaceholder: t('forms', 'Date question title'), + createPlaceholder: t('forms', ''), + submitPlaceholder: t('forms', 'Enter a date'), + warningInvalid: t('forms', 'This question needs a title!'), + }, + + datetime: { + component: QuestionDatetime, + icon: 'icon-answer-datetime', + label: t('forms', 'Datetime'), + + titlePlaceholder: t('forms', 'Datetime question title'), + createPlaceholder: t('forms', ''), + submitPlaceholder: t('forms', 'Enter a date'), + warningInvalid: t('forms', 'This question needs a title!'), + }, }