• Mark (unregistered)

    The frist wtf is that this article is published at thedailywtfdotcom /articles/remy-porter

  • bvs23bkv33 (unregistered)

    xmlctx comment_section = XmlCreate(&xerr, (oratext*)"comment section");

  • Raphael (unregistered)

    TRWTF is this article having the slug remy-porter.

  • (nodebb)

    The main WTF is of course the comparison between now and the entered expiry date...

    Almost all countries, both of departure and arrival, require something like six months' remaining validity, and in any case, they should be comparing the entered expiry date with the date of the (return) flight, no matter how much "surplus" time is required.

    And what is the justification for "based out of X" meaning "having its base in X"?

  • Better World one bug report at a time (unregistered)

    I wonder if anybody reported the bug to the airline so they get a chance to fix it.

  • RLB (unregistered)

    Of course, the real WTF is the completely inadequate (and that's me being nice, what I should really call it wouldn't pass any filters) date and time handling features in JavaScript. Yes, there are libraries, but this should be a basic part of a language with JS' field of operations. Even PHP's date functions are a massive improvement.

  • Marcin (unregistered)

    In symmetry, I attended a conference last year in Seattle and the organizers used a 3rd party site for the schedule. I do not remember the details now, but the Android version of their app did something strange to the listing. Grouped it by the date changes in Europe/Warsaw, but printed start/end hours for America/Los_Angeles. Or vice-versa. Lots of fun. Of course once I landed in Seattle, everything was fine.

    Someone somewhere said the dates are one of the hardest thing in programming (was it Computerphile?)

  • 🤷 (unregistered) in reply to Marcin

    "Someone somewhere said the dates are one of the hardest thing in programming (was it Computerphile?)"

    True. Which is why people much smarter than the average programmer (at least much smarter than me, that's for sure) have thought about this and that's why there are libraries that do this stuff for us. We don't need to reinvent the wheel, we can use existing libraries. It always baffles me what kind of solutions programmers come up with for date checks. About 99% of those "clever" solutions don't work.

  • Wizard (unregistered) in reply to Marcin

    I think you are refering to this (which every developer should be made to watch as if its the Ludovico Technique... infact how about adding into SOLID to make it SOLLID ;-)

    https://www.youtube.com/watch?v=-5wpm-gesOY

  • my name is missing (unregistered)

    The only thing worse that Dates are Timezones. Try defining booking a hotel room for tonight that works no matter where you are located in the world or the hotel is or when during a 24 hr period you are booking or where the server is located.

  • (nodebb)

    WTF? WTF? When traveling to visa-waiver (Schengen Agreement) countries like Poland, a passport's expiration must be at least 90 days after entry. So the now() timezone issue doesn't even matter.

  • dpm (unregistered)

    90 days after entry

    I live in the USA and am booking a cruise for Northern Europe. The line requires that all passports must be valid for six months after the cruise ends.

  • Little Bobby Tables (unregistered)

    Passports are a pointless bureaucratic exercise made "necessary" by the existence of the medieval anachronism that is the concept of the "national boundary". Privilege based on which side of an imaginary line you happened to be born on is utterly irrelevant in the modern world.

    No boundaries -- no wars -- no excuse for persecution and oppression.

  • anonymous (unregistered) in reply to RLB

    PHP honestly has the best date-handling functions I've seen. I've never needed to do something with dates that PHP can't handle. The amount of hate that PHP gets is undeserved for this reason alone.

    For JavaScript I quite like moment.js. Its approach to parsing is a bit weird and can lead to unexpected results if you don't read the documentation carefully but it can handle all of the "add X days to this timestamp", "compare these timestamps ", and "convert this to UTC" situations and most of the "turn this string into a date" situations.

  • get off my lawn (unregistered)

    Yes it's an error, but if you're booking just before your passport expires you're going to have big problems anyway.

  • Gumpy_Gus (unregistered)

    Reminds me way back when MSDOS decided that the hardware clock was not keeping perfect time, so they added code to the main tick handler to turn the clock back 50 milliseconds at midnight. If you read the clock at just the right time you would see time running backwards, which caused my task scheduler to hang. That was a fun one to find and fix. You have to protect your code from time running backwards I guess.

  • tbo (unregistered) in reply to 🤷

    Even with libraries you still need to be careful. Not many libraries will add "half a day" to a datetime, so you might be tempted to add 12 hours. Of course, if you're trying to go from 6PM yesterday to 6AM today, it's not always 12 hours later. Sometimes it's 11 or 13.

  • Dave (unregistered)

    It's a European short-haul airline. Almost all their customers are in the same time zone. Those who aren't are mostly pretty close, and those who aren't close will have proportionately fewer hours of the day in which it works, the further from the time zone they are - which is a fair proxy for how likely they are to be customers.

    Budget flights are very low margin for the carriers, so this literally may not be worth fixing, even if it only costs a fairly small amount.

  • (nodebb) in reply to Little Bobby Tables

    If only it was so. These boundaries separate groups of people who believe in different ideas. For example lots of people on the other side of the imaginary boundary believe in stoning and throwing people off roofs for various non crimes. I want them them well outside of my area, area defined by a boundary.

  • medievalist (unregistered) in reply to Mr. TA

    I live in the USA, and thus do not have to cross national borders to find people who believe in stoning and throwing people off roofs for various non crimes. They are just down the street, at the big fundamentalist revival. I can see their coal-rollers parked right outside.

  • (nodebb) in reply to medievalist

    Have you been eating mushrooms again? Haha

  • (nodebb)

    Explaining what you did to make the article simple to read by referring to more difficult things is not called the "Easy Reader Version"; it is called an "exercise to the reader".

  • Little Bobby Tables (unregistered) in reply to Mr. TA

    A little more close to home, a good example of how abolition (or at least, relaxation of certain restrictions) of boundaries has allowed for a continent-wide introduction of humanistic laws which protect the rights of citizens over corporations.

    Of course, certain factions whose interests are directly served by those corporations are unhappy at this state of affairs, and they want to abolish such laws preventing them forcing their employees to work more than a statutory maximum, and imposing a national minimum wage, and implementing a system of laws which ensure safe and humane working conditions. If an arbitrary boundary is set up which fences a region from that big boundary-less content, those laws that are made to apply to everywhere on that continent can be disregarded. Many people (me included) consider that to be a bad thing.

  • WTFGuy (unregistered) in reply to tbo

    @tbo: Of course you just raised the issue that the term "half a day" is ill-defined. It can either mean exactly 12 elapsed real-world hours or it can mean the same hour number with opposite AM/PM. Anyone thinking in terms of office business would assume the latter and anyone involved in the flow of transportation or production of material or money or such would favor the former definition.

    Yes, the underlying WTF is the ignorance of government mandated clock tweaking every few months. But we in this business should know better than to advocate for anyone, even an ignorant business user, being allowed to use an ill-defined unit of measure called "half a day"

  • RLB (unregistered) in reply to anonymous

    To be honest, yes, my "even" was undeserved. There's a lot I don't like about PHP, but the date/time functions are very extensive. (Sometimes a bit too extensive - too many functions to do essentially the same thing is one of PHP's weak points). SQL isn't all that bad, either.

  • I'm not a robot (unregistered) in reply to OllieJones

    Yes, it still matters. Regardless of whether you're comparing against the date printed on the passport or the date it actually stops being acceptable, you still need to do the comparison correctly, taking timezones into account according to whatever the established rule is.

  • (nodebb) in reply to Little Bobby Tables

    You're talking about harmonizing certain regulations, those may or may not be helpful. Regardless of whether they are helpful, countries agreeing to harmonize are doing it willingly. You don't want some people, say, Angela Merkel, to force everybody to do as she says, do you?

  • (nodebb) in reply to I'm not a robot

    I think the point is that when you're talking about a passport expiry 90 days in the future, there's some wiggle room. It shouldn't really matter if you're off by a few hours.

  • (nodebb) in reply to RLB

    First of all, this article has hardly anything to do with JavaScript and its dates. The date wasn't correctly validated, and that's all. Second, there's now native support for formatting dates: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat You need a polyfill for IE though.

    And third, another proposal is discussed to address the missing points, currently at stage 2: https://github.com/tc39/proposal-temporal

    The fact that you're preferring the clusterfrick that's PHP over a good JS library (and no, I'm not talking about moment.js... I said a good library) really boggles my mind.

  • Future (unregistered)

    As usual with Javascript, there is something that is "now" (too late) in Javascript, is a library or requires a polyfill.

  • FristName LastName (unregistered) in reply to Wizard

    That's one of Tom Scott's best rants. Thanks for the link.

Leave a comment on “Zoning Out”

Log In or post as a guest

Replying to comment #:

« Return to Article