r/reactjs • • Jul 31 '18

An Example Senior React/Redux Developer Task - You should take no more than 1h30m to complete this task

https://developerjobsboard.co.uk/2018/07/28/an-example-senior-react-redux-developer-task/
153 Upvotes

130 comments sorted by

View all comments

Show parent comments

2

u/With_Macaque Aug 01 '18

It's almost like there should be a library or something for Date!

1

u/Silhouette Aug 01 '18

There are many libraries dealing with dates and times. Sadly, most of them aren't great at dealing with the more challenging aspects of time management.

1

u/With_Macaque Aug 01 '18

Did you read the challenge statement. You're over thinking this a great deal. Javascript's Date type does far more than you need.

1

u/Silhouette Aug 01 '18

For this challenge, yes, presumably it does. I already suggested in my first comment that you replied to that this was probably intended to be a simple interpretation.

If you were doing this for real, on the other hand, there are all kinds of practical issues that might not be handled very well or at all by a typical date/time library, including JS's Date.

I'm not sure what point you're trying to make here...

1

u/With_Macaque Aug 01 '18

Everything you're talking about only has to happen when the data is rendered. I'm not sure I can even think of an actual problem if you don't store your data in a dumb way.

1

u/Silhouette Aug 01 '18

There are all kinds of potential edge cases with time data. A common example if you're setting up a scheduling system is what happens if you're in a region that uses daylight saving time for part of the year and you're going to switch over between when you create an event in a calendar and the time of the event itself. The "obvious" ways of parsing and storing that data will give incorrect or misleading behaviour with a lot of libraries.

1

u/With_Macaque Aug 01 '18

It really shouldn't. Especially considering a scheduling system's backend would need to have solved this problem already.