WIP - [PER-10416] Add date and time selection modal#924
WIP - [PER-10416] Add date and time selection modal#924aasandei-vsp wants to merge 7 commits intomainfrom
Conversation
77aad83 to
adb771a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #924 +/- ##
==========================================
+ Coverage 48.69% 50.10% +1.40%
==========================================
Files 350 359 +9
Lines 11339 11956 +617
Branches 1898 2104 +206
==========================================
+ Hits 5522 5991 +469
- Misses 5627 5735 +108
- Partials 190 230 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e5ac965 to
f4748a1
Compare
cecilia-donnelly
left a comment
There was a problem hiding this comment.
I'm sorry, I forgot to finish and submit this!
| day: string; | ||
| } | ||
|
|
||
| const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
There was a problem hiding this comment.
It seems wrong for us to keep track of this ourselves - is there a way to use a library?
| if (!m || m < 1 || m > 12) return 31; | ||
|
|
||
| if (m === 2 && y) { | ||
| return this.isLeapYear(y) ? 29 : 28; |
There was a problem hiding this comment.
I see you handle February here, but it does seem strange to have to write this ourselves.
|
|
||
| endTime = signal<TimeObject>({ ...DEFAULT_TIME }); | ||
|
|
||
| edtfValue = computed(() => { |
There was a problem hiding this comment.
EDTF can get complicated - I would use something like https://www.npmjs.com/package/edtf?activeTab=readme for parsing
There was a problem hiding this comment.
That one might be better suited to transforming a stored EDTF date back into something that makes sense on the client? Generally just saying that we don't need to write all the logic ourselves!
543c7d2 to
373b5ca
Compare
This new component will be presentational, it will get a date input and it will also return a selected date. It includes a calendar. Issue: PER-10416
The time picker is a presentational component, its input si a time object and it returns a time object as well. It contains a time selector. It works with meridian. Issue: PER-10416
The edit date and time component is smart, because it manages its own state, but also the states of the time and date pickers. But still the state is isolated to this specific component, it gets as input a date and time object and returns back a date and time object. It handles the time picker, the date picker, the date qualifiers, start and end time and also shows an edtf calculated value. Issue: PER-10416
The service has the resposability to open the modal for the edit date time component and provide the initial data. Issue: PER-10416
Because we are using the timezone dropdown component in three places now, extracting it into a presentational component for reusability seems the right approach. It will be a generic isolated component that will provide an input and a dropdown for choosing the timezone. Issue: PER-10416
373b5ca to
400b7dc
Compare
This component will be the smaller version to set the date and time, it will open the modal editor for more comporehensive choices. Issue: PER-10416
400b7dc to
db36d72
Compare
Issue: PER-10416
No description provided.