You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another thing is that this entire calculation is wrong. For example, not all years have 365 days. Date-time calculations is a very hard topic, and it is somewhat unreasonable to try and do on the spot. There are specialized high-quality libraries exist to do this correctly, e.g. luxon (continuation of moment.js). And then for human durations there are also small libs (e.g. this). Not even talking about that calendars and durations are different in different cultures.
The text was updated successfully, but these errors were encountered:
In this particular case, James convinced me in the linked thread that because the output is for human consumption and vague/approximate by design, then it does not necessarily make sense to spend energy on being pedantic here.
There are many examples of reinventing the wheel in the org's code. And it kinda works. So the team probably has better things to do.
(As of my general preferences, I believe if a precise, typed one-liner requiring no maintenance is available on npm, then it should be prioritized, at least when writing new code)
nextstrain.org/static-site/src/components/ListResources/Modal.tsx
Lines 134 to 146 in aae874c
from @ivan-aksamentov in #874 (comment):
Another thing is that this entire calculation is wrong. For example, not all years have 365 days. Date-time calculations is a very hard topic, and it is somewhat unreasonable to try and do on the spot. There are specialized high-quality libraries exist to do this correctly, e.g. luxon (continuation of
moment.js
). And then for human durations there are also small libs (e.g. this). Not even talking about that calendars and durations are different in different cultures.The text was updated successfully, but these errors were encountered: