sendou.ink/app/utils
William Lam 09851faf83
New Date entry on the new Calendar page is now based off the previous one (#1070)
* Issue 858: On the new calendar page adding a new Date entry with the "Add" button will now insert a new date with an offset of +24 hours of the previous row's date value.

* Added comment to ignore the TSLint "object can be null" error

* Changed `var` to `const`

* Fixed Prettier checks in CI pipeline

* Fixed Typecheck CI pipeline error

* Moved getDateWithHoursOffset() function to app/utils/dates.ts

* Added new line at end of file

* Added getValidNewDateIfInvalid() function. This retrieves a valid date. If invalid, get a new Date object.
- So now, if we intentionally/accidentally delete the data in the Calendar's DateInput element, it will be reset to the current Date/Time

* Refactored DateInput component's update state mechanism to be handled by an onChange() function defined in the parent component that is passed to the child

* Prettier formatting so that the new CI pipeline won't output errors at me

* Removed unused imported types

* Removed the datesCount React Hook & refactored accordingly

* Removed unused loader-related variables

* DateInput onChange prop is now optional

* Instead of generating a new Array, iterate over DateInput's inputState's array instead

* Fix potential undefined error

* DatesInputState: refactored to remove index & access the index during iteration with map() 2nd arg

* Properly initialized state for pre-existing events =)
- Also added TODO comments for improving date input handling (1082)

* Prettier formatting

* Uncommented console.warn()

* Touched up comment
2022-10-31 03:59:51 +01:00
..
arrays.ts Refactor breadcrumbs into a component that uses route handles 2022-10-21 00:48:58 +02:00
dates.ts New Date entry on the new Calendar page is now based off the previous one (#1070) 2022-10-31 03:59:51 +01:00
fetch.ts Patreon pledge data parsing endpoint initial 2022-07-10 12:27:02 +03:00
i18n.server.ts Translate user page 2022-07-17 13:38:57 +03:00
i18next.ts Object damage filter by damage type 2022-10-23 12:50:25 +03:00
images.ts User page initial with SQLite3 (#822) 2022-05-16 17:52:54 +03:00
number.ts Make damage use rounding that matches data struct 2022-10-23 12:01:05 +03:00
remix.ts More type safety to SendouRouteHandle.navItemName 2022-10-22 12:40:36 +03:00
sql.ts Custom URL submitting error handling 2022-10-02 00:43:55 +03:00
strings.ts Build card gear name title on hover 2022-10-29 21:46:39 +03:00
types.ts Submit votes initial 2022-06-12 15:11:23 +03:00
unslugify.server.ts Fix weapon deslugifying not working w/ other langs 2022-09-25 16:36:23 +03:00
urls.ts Add event search to map pool templates 2022-10-27 13:31:37 +02:00
zod.ts Extra infos on user page 2022-10-02 12:20:19 +03:00