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

    Date formatting: Locale of short days and short months names

    Help
    4
    5
    2321
    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.
    • A
      arturo.galan last edited by

      Hi everybody,
      I’m formatting dates with quasar Date, and I want to pass my locale short day names ‘ddd’ (3 characters spanish names like [‘Lun’,‘Mar’,‘Mier’…]) as a parameter to the formatDate function, in the doc I only find two properties, one for long day names and other for long month names.
      Any way to achieve this, passing properties to this formatDate function, or setting the internal quasar i18n locale in some way? And for short months names also?
      Thanks in advance!

      let formattedString = date.formatDate(timesStamp, 'MMMM - dddd', {
        dayNames: ['Duminica', 'Luni', /* and all the rest of days - remember starting with Sunday */],
        monthNames: ['Ianuarie', 'Februarie', /* and all the rest of months */]
      })
      
      1 Reply Last reply Reply Quote 0
      • benoitranque
        benoitranque last edited by

        Possible on v0.15, docs will be out soon!

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

          I’m using v0.15 and it does not work for me.

          date.formatDate(
            new Date('2018-04-02'), 'MMMM',
              {
                monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre'] 
              }
          )
          

          shows me : April instead of Avril

          Any idea of what I’m doing wrong ?

          1 Reply Last reply Reply Quote 2
          • J
            J3m5 last edited by

            @Al1_andre I have the same problem, did you found the solution?

            1 Reply Last reply Reply Quote 0
            • J
              J3m5 last edited by J3m5

              I’ve solved it.
              In fact we don’t have to specify any month names for the language we are translating to if it’s supported by Vue l18n
              But we have to specify a language pack in the framework property in quasar.conf.js.
              So now I have the month in the language I want.

              It’s explained in the in the internationalization section of the docs but it’s not mentioned in the date utils section…

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