7 ms·
> (Side note, it's wild that npm, bun, and pnpm have all decided to use different time units for this configuration.) First day with javascript?
by friendzis 7mo ago
> (Side note, it's wild that npm, bun, and pnpm have all decided to use different time units for this configuration.)
First day with javascript?
- gib444 7mo agoOP should be glad a new time unit wasn't invented
- cyrusmg 7mo agoN multiplications of dozen-second
- friendzis 7mo agoWorkdays! Think about it, if you set the delay in regular days/seconds the updated dependency can get pulled in on a weekend with only someone maybe on-call. (Hope your timezones and tzdata correctly identifies Easter bank holiday as non-workdays)
- yohannesk 7mo agoAnd we also need localization. Each country can have their own holidays
- rolandog 7mo agoAnd we need groups of locales for teams that are split across multiple locations; e.g.: new_date = add_workdays( workdays=1.5, start=datetime.now(), regions=["es", "mx", "nl", "us"], )
- deleted 7mo ago[deleted]
- wongarsu 7mo agoDon't forget about regional holidays, which might follow arbitrary borders that don't match any of the official subdivisions of the country. Or may even depend on the chosen faith of the worker
- reaperducer 7mo agoPulaski day in Illinois. Or Reds Opening Day in Cincinnati.
- berkes 7mo ago> Workdays! This is javascript, not Java. In JavaScript something entirely new would be invented, to solve a problem that has long been solved and is documented in 20+ year old books on common design patterns. So we can all copy-paste `{ or: [{ days: 42, months: 2, hours: "DEFAULT", minutes: "IGNORE", seconds: null, timezone: "defer-by-ip" }, { timestamp: 17749453211*1000, unit: "ms"}]` without any clue as to what we are defining. In Java, a 6000LoC+ ecosystem of classes, abstractions, dependency-injectables and probably a new DSL would be invented so we can all say "over 4 Malaysian workdays"
- whatisthiseven 7mo agoBut you know that Java solution will continue working even after we no longer use the Gregorian Calendar, the collapse and annexation of Malaysia to some foreign power, and then us finally switching to a 4-day work week; so it'd be worth it.
- nesarkvechnep 7mo agoIt probably won’t work correctly from the get go. But it can be debugged everywhere so that’s good.
- berkes 7mo ago... and since it was architectured to allow runtime injection-patching of events before they hit the enterprise-service-bus, everyone using this library must first set fourteen ENV vars in their profile, and provide a /etc/java/springtime/enterprise-workday-handling/parse-event-mismatch.jar.patch. Which should fix the bug for you. You can find the patch files for your OSs by registering at Oracle with a J3EE8.4-PatchLibID (note, the older J3EE16-PatchLib-ids aren't compatible), attainable from your regional Oracle account-manager.
- hluska 7mo agoThis isn’t even remotely funny.
- sverhagen 7mo agoWhy would it get pulled in over the weekend? What automatic deployments are you running if there also isn't a human working to get it out? Do you run automatic dependency updates over the weekend? Wouldn't you rather do that during fully-staffed hours?
- ecshafer 7mo agoWhen I worked in Finance our internal Date extension did actually have Workdays that took into account Stock Market and Bank Holidays.
- tsukikage 7mo ago…now imagine a list of instruments, some of which have durations specified in days/weeks/months (problems already with the latter) and some in workdays, and the user just told your app to display it sorted by duration.
- matltc 7mo agoI tried to write this function in Power Query (Excel hell). Gave up after an hour or so.
- brunoarueira 7mo agoMe too, it was just a constant filled with bank holidays for the next 6 years
- dspillett 7mo agoNah, working hours and make global assumptions of 0900-1230/1330-1730, M-F, and have an overly convoluted way to specify what working ours actually are in the relevant location(s).
- ghurtado 7mo agoIf we're taking suggestions, I'd like to propose "parsec" (not to be confused with the unit of distance of the same name) That way Han Solo can make sense in the infamous quote. EDIT: even Gemini gets this wrong: > In Star Wars, a parsec is a unit of distance, not time, representing approximately 3.26 light-years
- latexr 7mo ago> That way Han Solo can make sense in the infamous quote. They explained it in the Solo movie. https://www.reddit.com/r/MovieDetails/comments/ah3ptm/solo_a_star_wars_story_cleverly_explains_how_the/ https://www.reddit.com/r/MovieDetails/comments/ah3ptm/solo_a...
- binarymax 7mo agoMaking a whole movie just to retcon the parsec misuse in Ep IV was a choice
- latexr 7mo agoThey made a movie to make money. I doubt anyone holding the purse strings cared one iota if that bit were corrected or not. It’s not really a retcon either because they didn’t change anything.
- slavik81 7mo agoThat had more or less been the explanation in the books for decades, and even in George Lucas' notes from 1977: > It's a very simple ship, very economical ship, although the modifications he made to it are rather extensive – mostly to the navigation system to get through hyperspace in the shortest possible distance (parsecs).
- inopinatus 7mo agoIt was already fine, because it’s a metric defined on a submanifold of relativistic spacetime.
- slowmovintarget 7mo ago
- deleted 7mo ago[deleted]
- notpushkin 7mo agoYou mean first 86,400 seconds?
- x0x0 7mo agoYou have to admire the person who designed the flexibility to have 87239 seconds not be old enough, but 87240 to be fine.
- raverbashing 7mo agoThis is the difference between thinking about the user experience and thinking just about the technical aspect
- zelphirkalt 7mo agoI actually think it is not too bad a design, because seconds are the SI base unit for time. Putting something like "x days" requires additional parsing steps and therefore complexity in the implementation. Either knowing or calculating how many seconds there are in a day can be expected of anyone touching a project or configuration at this level of detail.
- wongarsu 7mo agoSeconds are also unambiguous. Depending on your chosen definition, "X days" may or may not be influenced by leap seconds and DST changes. I doubt anyone cares about an hour more or less in this context. But if you want multiple implementations to agree talking about seconds on a monotonic timer is a lot simpler
- sverhagen 7mo agoI came here to argue the opposite. Expressing it in seconds takes away questions about time zones and DST. I think you're incorrect to say that second are also ambiguous. Maybe what you mean is that days are more practical, but that seems very much a personal preference.
- vasco 7mo agoTo me it sounds safer to have different big infra providers with different delays, otherwise you still hit everyone at the same time when something does inevitably go undetected. And the chances of staying undetected are higher if nobody is installing until the delay time ellapses. It's the same as not scheduling all cronjobs to midnight.