Code Monkey home page Code Monkey logo

Comments (7)

clemens avatar clemens commented on August 28, 2024

Could you post the YAML file where you've specified your date formats?

from delocalize.

roodion avatar roodion commented on August 28, 2024

@clemens , thank you for quick answer. i'm very appreciate it.
Yes, i have a custom yaml locale.. (here is some different with original rails-i18n date format)

fr:
date:
abbr_day_names:
- dim
- lun
- mar
- mer
- jeu
- ven
- sam
abbr_month_names:
- ~
- Janv.
- Févr.
- Mars
- Avril
- Mai
- Juin
- Juil.
- Août
- Sept.
- Oct.
- Nov.
- Déc.
day_names:
- dimanche
- lundi
- mardi
- mercredi
- jeudi
- vendredi
- samedi
formats:
default: "%b %d, %Y"
short: "%e %b"
long: "%e %B %Y"
month_names:
- ~
- janvier
- février
- mars
- avril
- mai
- juin
- juillet
- août
- septembre
- octobre
- novembre
- décembre
order:
- :day
- :month
- :year

from delocalize.

clemens avatar clemens commented on August 28, 2024

As it says in the readme (see https://github.com/clemens/delocalize#what-does-it-do-and-how-do-i-use-it), you need to specify an input.formats array so delocalize can actually figure out which formats to accept. If it can't find fitting formats, it just falls back to the current date and time. Yes, this is a little odd – but I needed this so I could parse dates without years so I thought, I might as well use all values of the current date and time as default.

In short: Make sure the keys date.input.formats and time.input.formats are defined (after you've added them to the YAML file, make sure I18n.t('date.input.formats') and I18n.t('time.input.formats') return proper values). Then everything should work.

from delocalize.

roodion avatar roodion commented on August 28, 2024

@clemens , great, thank you, sir!
will try & share results with you.

from delocalize.

clemens avatar clemens commented on August 28, 2024

Any news? Can I close this?

from delocalize.

clemens avatar clemens commented on August 28, 2024

Any updates? Otherwise I'll close this.

from delocalize.

clemens avatar clemens commented on August 28, 2024

Closing this for inactivity. Please comment if you want it reopened.

from delocalize.

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.