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 customize Q-Date's year

    Help
    2
    6
    302
    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.
    • K
      kuma46 last edited by kuma46

      Hi all,
      Some countries do not use A.D., like Japan.
      I would like to know how to customize Q-Date’s year.
      Because I need to subtract 1911 from A.D. as Q-Date pick year.
      Thank you.

      1 Reply Last reply Reply Quote 1
      • s.molinari
        s.molinari last edited by

        Use the date utilities.

        https://quasar.dev/quasar-utils/date-utils

        Scott

        1 Reply Last reply Reply Quote 1
        • K
          kuma46 last edited by kuma46

          @s-molinari I spent some time and I still didn’t seem to succeed.
          Also found that my description was wrong
          subtractFromDate is not what I need
          I made some diagrams to illustrate my needs.
          Sorry to my poor long English expression.
          I made a Codepen to express my problem, but the choice of the year should be the same as the picture.
          V-model is “2020-03-31” but datepick’s year need show “民國109” (2020subtract1911)
          https://codepen.io/bebe199671554/pen/ZEGwPNN?editable=true&editors=101
          date3.pngdate4.png date1.png

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Looking at this, you are going to need to do a lot more. https://github.com/commenthol/date-chinese/blob/master/src/Chinese.js

            Scott

            K 1 Reply Last reply Reply Quote 0
            • K
              kuma46 @s.molinari last edited by kuma46

              @s-molinari Thanks for the reply, the Republic of China calendar(it has another name call “TaiwanCalendar”) is not the lunar calendar(Chinese calendar), it is closer to wareki(Japan calendar).
              Only need to change the year display instead .
              Not complicated calculations
              like …
              AD 2020-03-31 same about the ROC calendar 109-03-31 (They’re the same as Tuesday)
              Republic of China calendar start about 1912 AD.
              99f7e587-4f3d-4d90-833e-e860f1363d18-image.png
              The ROC calendar works exactly like the Gregorian calendar, except that the year and era are different.

              like…emmmm…this one?C# taiwancalendar

              Sorry for that. Maybe I should e.g. wareki .

              In Japanese calendar(wareki) 2019AD is call “令和元年”(Reiwa 1st year)
              2020AD is call Reiwa 2st year
              6b1c9733-805c-4251-bb27-f3bacf158368-image.png

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                Unfortunately, I don’t think this is going to work. The QCalendar looks for the date and builds the calendar accordingly. So, if you switch the years to 109, you end up with the 31st of March on a Sunday. So, it’s still the Gregorian calendar being shown.

                Adding an option for the ROC calendar would require an improvement request in GH.

                Scott

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