From e0e847784da1539a6644fcc711a3bda2240f57ee Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 25 Mar 2019 15:21:46 -0400 Subject: [PATCH] LP#1831780: various improvements to the Angular date-select widget Styling ------- - the widget is now narrower - the widget now enables form validation styles; in particular, entry of an incorrectly-formatted date is now highlighted - the calendar drop-down is now allowed to overflow the containing element when expanded, making it easier to embed the date selector in other controls - the calendar button (and any material icons button that's part of an input group) now has the same default font size as main text, making the overall date-select look cleaner API --- - add a reset() method - hitting enter in the text box can now triggers emitting date change events - a new onCleared event is emitted if the suer hits enter on an empty input - onChangeAsYmd() now pads month and day to two digits apiece, making the result conform to ISO 8601 and thus more easily plugged into queries. - adds the following methods to retrieve the current date; these are meant to be used via local template references in parent templates: currentAsYmd() currentAsIso() currentAsDate() Sponsored-by: MassLNC Sponsored-by: Georgia Public Library Service Sponsored-by: Indiana State Library Sponsored-by: CW MARS Sponsored-by: King County Library System Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- .../date-select/date-select.component.css | 3 ++ .../date-select/date-select.component.html | 6 ++- .../date-select/date-select.component.ts | 51 ++++++++++++++++++- Open-ILS/src/eg2/src/styles.css | 4 ++ 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css new file mode 100644 index 0000000000..277f1314ce --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css @@ -0,0 +1,3 @@ +.eg-date-select { + max-width: 11em; +} diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html index 7e65f7628e..41425339a3 100644 --- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html +++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html @@ -1,16 +1,18 @@ -
- +