• Resolved Adriders

    (@adriders)


    Hi,

    How can we change the dateformat language in a twig template?
    When showing the day we get the english day: Saterday

    We want to show it in Dutch: Zaterdag

    Any idea how to do this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author berkux

    (@berkux)

    Hi,

    good point. Yet the plugin / twig can’t do this as it uses the default PHP date.
    I’ll add this in the next pro-version by an twig-extension.
    This will take some time—

    Bernhard

    Thread Starter Adriders

    (@adriders)

    Hi Benhard,

    Many thanks for your quick work on this.

    I tested it out:

    url: https://data.sportlink.com/programma?client_id=FSSFj408zh&teamcode=32468&aantalregels=1

    {{ item.kaledatum | dateformat(‘%A %d.%m/%y’, ‘Europe/Berlin’, ‘nl_NL’) }}
    I don’t get the result I hoped fot, can you check this?

    It should also be nice if we can use: D (this are the first 3 chars off a day)

    Is it also possible to use date and use it like this:
    {{item.kaledatum | date(‘D d.m.y ‘ , ‘Europe/Berlin’, ‘nl_NL’)}}
    expected output: Din 17.01.17

    Many thanks!

    Plugin Author berkux

    (@berkux)

    Hi,

    you’re right. dateformat can only handle unix-timestamps in this version. But this is easy to fix. The next version will handle the format of the date in this JSON. This will be on next friday.

    Bernhard

    Thread Starter Adriders

    (@adriders)

    Many thanks Bernhard. It is working perfectly.

    Plugin Author berkux

    (@berkux)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Date’ is closed to new replies.