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

    Datetime value

    Framework
    3
    5
    2082
    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.
    • druppy
      druppy last edited by

      I have been trying to use the q-datetime component, and it looks nice and all, but I really wonder why the input output value is not a plain old JS Date class and not a moment formattet ISO string.

      JS has many strange features :-), but the date class is very handy, and it feels natural to use for exchanging date related data.

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

        I would guess it is because Moment also takes care of formatting for locales (i18n), which is also built into Quasar.

        http://quasar-framework.org/guide/app-troubleshoot-and-tips.html#Configuring-Momentjs-Localization

        Scott

        1 Reply Last reply Reply Quote 0
        • druppy
          druppy last edited by

          This is a sensible thing not to reinvent date formatting, but as datetime transportation type the build in Date class has all that is needed, and when using Typescript it makes even more sense than using a string that need a certain ISO format.

          Could we are leased make q-datetime accept both as value ?

          1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin last edited by

            We will. I’d even be happy to drop the Momentjs dependency altogether. There’s a lot of work to be done for this as Momentjs is not used only for formatting a date.

            1 Reply Last reply Reply Quote 0
            • druppy
              druppy last edited by

              It may be a good idea to make formatting optional, but this is more and less becoming the JS default way of handling data formatting, so one may be using it somewhere else.

              q-datetime could have an optional format function, to delegate this to the user of the component, and eliminate the use of moment if not strictly needed. But is is nice that you are thinking about this, to slim down the code.

              But using pure dates for all value in date time relation, would be really nice.

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