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 implement timezone selector? (Quasar best practice)

    Help
    2
    4
    238
    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.
    • N
      nobilik last edited by

      Hi! I’m making an app that will generate some reports. User can have some projects each of that can belongs to different timezones and reports should consider this. I do understand how to get time in selected location from string (ex. “Europe/Moscow”) at the backend, but how to get selectable list of zones in Quasar?
      I guess that can be done with momentjs, but there is a warning about this. Thanks for help in advance!

      qyloxe 1 Reply Last reply Reply Quote 0
      • qyloxe
        qyloxe @nobilik last edited by

        @nobilik I would tend to use the same timezones as with my backend db.

        For example: in Postgres it could be done like below. BUT - please see, that there are 200 of those, and this specific query is quite time consuming, so I would consider using cache for that tz data on client side:

        35a7c9fb-d447-45d2-a693-d9886b87d10c-image.png

        N 1 Reply Last reply Reply Quote 0
        • N
          nobilik @qyloxe last edited by

          @qyloxe Thanks for suggestion! But 5 sec for 200 rows???
          For query

          SELECT DISTINCT(name) FROM pg_timezone_names WHERE name NOT LIKE '%posix%';
          

          I have 113 ms for 608 rows…
          However, there are some names like “Factory”, “GMT/+8”, etc. that make things looks ugly… I’ll take a look how to avoid them.

          qyloxe 1 Reply Last reply Reply Quote 0
          • qyloxe
            qyloxe @nobilik last edited by

            @nobilik said in How to implement timezone selector? (Quasar best practice):

            @qyloxe Thanks for suggestion! But 5 sec for 200 rows???

            Yep - I like to test queries with so called “cold cache”. This gives me a “worst case” scenario. Of course, the next queries will return in ms, but in production, with high load, there is a possibility, that the cache will be cleared/overflowed and this specific query could take 5 secs again. Because I know that beforehand I could take some actions and not be surprised. This is a nice article:

            https://madusudanan.com/blog/understanding-postgres-caching-in-depth/

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