Skip to content

Resolve "Replace custom date functions with library `date-fns`"

Carlos Sanchez requested to merge 153_second_try into main

As !61 kind of got out of hand another iteration with less changes.

What I did:

  • Use date-fns functions in DateString
  • Reworked one function in BasicDataViewService to get rid of some functions in CalendarDateString
  • Added documentation

Questions:

  • How do you feel about renaming DateString to CalendarDateString to emphasize it handles only calendar dates?
  • Do the added docs help?

Future:

  • Should we create an issue for a Date module to encapsulate date-fns? I am devided on this. It feels like it might be a good time investment if we want to change the library, but now it would mostly be functions calling the date-fns function.
  • I feel like we should only use calendar date strings (YYYY-MM-DD) where necessary and use Dates where we want to calculate stuff. Imho it is too much to always convert string to date and back again. (But keeping it string is no good option imho neither)
Edited by Carlos Sanchez

Merge request reports

Loading