No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to use Date Utils - getDayOfWeek

    Help
    1
    2
    123
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fivemikes last edited by

      Hello

      I’m trying to use the getDayOfWeek function. The following code returns a 5 for the first day of 2019. According to the calendar the first day of 2019 is a Tuesday. How do you equate 5 to Tuesday? I would expect it to return either a 3 or a 2 depending on whether a week starts with Sunday or Monday respectively.

      import { date } from "quasar";
      console.log("index is: " + date.getDayOfWeek(new Date(2019, 1, 1)));
      

      thanks

      1 Reply Last reply Reply Quote 0
      • F
        fivemikes last edited by

        I’m still fairly new to Javascript and after more research I’ve learned the the month is zero based in Javascript so my above date is actually referring to the Month of February which would make the return result of 5 make sense.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post