LP1879517: Surveys shouldn't end before they begin
authorJane Sandberg <js7389@princeton.edu>
Thu, 21 Jul 2022 00:00:24 +0000 (20:00 -0400)
committerJason Boyer <JBoyer@equinoxOLI.org>
Thu, 30 Mar 2023 22:24:47 +0000 (18:24 -0400)
commit3784f9fdccdeb1d0a5f89cf46b6ff76503b1c5c7
treee2d139bcdc6fd5a59dd4258b8ca0fac53f23e812
parenteb98d1d7aec54ad59ca3076c70b939439d86e499
LP1879517: Surveys shouldn't end before they begin

To test:
1. Go to Admin > Local > Surveys.
2. Create a new survey.
3. Attempt to create a survey where the end date
comes before the start date.  Without this patch, you will get
no notice that this is invalid, and you can save the invalid
record.
4. Edit an existing survey.
5. Repeat step 3 while editing the existing survey.
6. Apply the patch.
7. Repeat steps 1-5.  Note that you now get a notice and
cannot save if the end date is before the start date.

This commit generalizes a validator already present in the booking
module, and corrects several small bugs related to the datetime-select
component.

Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Signed-off-by: Susan Morrison <smorrison@georgialibraries.org>
Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
14 files changed:
Open-ILS/src/eg2/src/app/core/format.service.ts
Open-ILS/src/eg2/src/app/core/format.spec.ts
Open-ILS/src/eg2/src/app/share/datetime-select/datetime-select.component.spec.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/datetime-select/datetime-select.component.ts
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
Open-ILS/src/eg2/src/app/share/validators/dates_in_order_validator.directive.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/validators/dates_in_order_validator.spec.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey-edit.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/survey/survey.component.ts
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.html
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/common.module.ts