Yes, someone actually did this and I found it running on our server

    • @[email protected]
      link
      fedilink
      18 months ago

      dayOfWeek is clearly represented by 1-7 in the example, with Sunday being 1.

      So, I guess the answer is “depends on what date library you’re linking against”

    • DroneRights [it/its]OP
      link
      fedilink
      English
      -10
      edit-2
      8 months ago

      Sunday is 1 0 and Saturday is 7 6. You just made Friday part of the weekend You forgot Sunday

        • Zagorath
          link
          fedilink
          11
          edit-2
          8 months ago

          Both Monday and Sunday are used as the first day of the week with quite some regularity. It’s a completely arbitrary standard no different to "the tenth month is the one called “October”. Or dividing a day into 24 segments which are each broken into 60 smaller segments of 60 even smaller segments. You can’t say either is “wrong” per se.

          Personally, I was brought up learning Sunday is the first day of the week, but at some point decided that was bullshit partly because it’s the week end. But also just from a practical standpoint when looking at a calendar, it’s useful to have the weekend days grouped together.

          • Cosmicomical
            link
            fedilink
            38 months ago

            Funny thing, september comes from the number 7, october from 8 and november and december from 9 and 10, as the year in ancient rome was starting around march. This problem is timeless.

            • Zagorath
              link
              fedilink
              English
              28 months ago

              Huh. I knew about the problem (that’s why I used October as my example, rather than, say, February), but I was mistaken as to the cause. The way I had always heard it told, September–December don’t match their current place in the year because of the addition of July and August. But I just looked it up and it seems you’re right. Those months are merely renamings of Quintilis and Sextilis, and the numbering issue comes from moving the start of the year from March to January.

          • @[email protected]
            link
            fedilink
            198 months ago

            Ah the same place that uses feet and inches, and puts the month before the day, and cannot read a 24 hour clock?

            • DroneRights [it/its]OP
              link
              fedilink
              English
              28 months ago

              That’s nice, you can run weekend = dayOfWeek > 5 and then explain to the boss why clients are getting work texts on a sunday

                • DroneRights [it/its]OP
                  link
                  fedilink
                  English
                  28 months ago

                  I’ll be sure to tell my boss to throw away all the work he already paid for and start over in a different language. I’m sure he’ll be very understanding

                • Cosmicomical
                  link
                  fedilink
                  28 months ago

                  Yo nodejs is just plain amazing. We should just keep improving on js and replace all other languages. Js is already on all browsers, by adopting it on the server you get huge efficiency as you can move code AND coders between backend and frontend. Of course you must make the right choices of practices and frameworks for this to be possible

            • DroneRights [it/its]OP
              link
              fedilink
              English
              -1
              edit-2
              8 months ago

              That’s nice, you can run weekend = dayOfWeek > 5 and then explain to the boss why clients are getting work emails on a sunday

        • @[email protected]
          link
          fedilink
          1
          edit-2
          8 months ago

          Depending on how you’re counting your integers, Monday is 0, being the first day of the week.