Git Product home page Git Product logo

Comments (5)

rluiten avatar rluiten commented on June 23, 2024 1

The updated french config is published in 9.1.2.

from elm-date-extra.

rluiten avatar rluiten commented on June 23, 2024

What format string are you using and what is the expected result verse the actual result you receive ?

Here is an example on Ellie that might make it easier for you to provide an example.
https://ellie-app.com/47J5ZYs396Fa1/4

In my timezone the result is.

1 => Hour(24): 22 Hour(12): 10 Suffix: [PM] offset: +1000
2 => Hour(24): 01 Hour(12): 01 Suffix: [AM] offset: +1000

from elm-date-extra.

rluiten avatar rluiten commented on June 23, 2024

I just reread your description and maybe you are saying the defaults for french you don't believe are accurate ?

The file Config_fr_fr.elm defines the standard formats.
This is the current values of the format strings.

format =
        { date = "%-d/%m/%Y" -- d/MM/yyyy
        , longDate = "%A, %-d %B %Y" -- dddd, d MMMM yyyy
        , time = "%-I:%M %p" -- h:mm tt
        , longTime = "%-I:%M:%S %p" -- h:mm:ss tt
        , dateTime = "%-d/%m/%Y %-I:%M %p" -- date + time
        , firstDayOfWeek = Date.Mon
        }

from elm-date-extra.

FabienHenon avatar FabienHenon commented on June 23, 2024

Sorry for my late answer.

Yes, the defaults are not correct. Here is my updated version (note that I couldn't access the Default module for the twelveHourPeriod variable):

frenchConfig : Config.Config
frenchConfig =
    { i18n =
        { dayShort = French.dayShort
        , dayName = French.dayName
        , monthShort = French.monthShort
        , monthName = French.monthName
        , dayOfMonthWithSuffix = French.dayOfMonthWithSuffix
        , twelveHourPeriod = (\a -> "")
        }
    , format =
        { date =
            "%-d/%m/%Y"
            -- d/MM/yyyy
        , longDate =
            "%A, %-d %B %Y"
            -- dddd, d MMMM yyyy
        , time =
            "%-H:%M"
            -- h:mm tt
        , longTime =
            "%-H:%M:%S"
            -- h:mm:ss tt
        , dateTime =
            "%-d/%m/%Y %-H:%M"
            -- date + time
        , firstDayOfWeek = Date.Mon
        }
    }

As you can see, I'm using %H for hours and not %I and I don't use %P any more because in France we only use 24h format ;)

By the way, what is the - (hyphen) used for between % and the format letter?

from elm-date-extra.

rluiten avatar rluiten commented on June 23, 2024

The doc for the formatting codes is at https://github.com/rluiten/elm-date-extra/blob/master/DocFormat.md.

The link to DocFormat use to work on elm site but I dont think it works anymore elm, I will look at correcting that with this update.

The - prefix means the the number is output as 1 or 2 digits, no padding zeros to always make it 2 digits.

Just checked Moment.js french format and they use 2 digits for hours, so I'll modify that as well.

from elm-date-extra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.