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

    [v1] date.isValid(val, 'DD/MM/YYYY') ??

    Framework
    2
    3
    1110
    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.
    • labs20
      labs20 last edited by

      There is any way to check if a date of a different locale is valid using Date Utils without having to decompose it to a YYYY/MM/DD string?

      Suggestion 1: Cant functions like isValid take a second mask parameter to indicate the valid input format?

      Suggestion 2: Date Utils could have a “setLocale” function to make all of its functions handle date format accordingly.

      Thanks!

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

        @labs20 1. you can use date.extractDate first then date.isValid date.isValid(date.extractDate('yourDateString', 'locale')) https://quasar.dev/quasar-utils/date-utils#Extract-Date.
        2. date utils is not a class, you can compose one though and import the quasar date utils in it, using its functions to shape functionalities according to your needs.

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

          @metalsadman Thanks for your reply!

          Yes, the double function combo is what I was doing, it just looks more concise IMHO to have a second parameter and keep things simpler.

          Thanks for you help!

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