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:34 +0000 (18:24 -0400)
commit46d34807ee5b14839e96640f7340965790c1b144
treea386ecdb7bd8d2d6e9532c91207a4ba8f49f9338
parent30803df19483f9094e47af1d3c248d13476a18ef
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