Comments (7)
Could you post the YAML file where you've specified your date formats?
from delocalize.
@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.
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.
@clemens , great, thank you, sir!
will try & share results with you.
from delocalize.
Any news? Can I close this?
from delocalize.
Any updates? Otherwise I'll close this.
from delocalize.
Closing this for inactivity. Please comment if you want it reopened.
from delocalize.
Related Issues (20)
- Delocalize in Production HOT 2
- Delocalize does not work with Gem best_in_place HOT 3
- dirty attributes are not correctly set HOT 7
- License missing from gemspec HOT 2
- rails g fails - 0.3.1 HOT 1
- not working in rails/ruby 2 HOT 7
- thousand problem HOT 2
- Error delocalizing params with nested attributes HOT 3
- Parsing a localized date HOT 3
- Rails 4.2 compatibility HOT 13
- Setting an invalid value in a time field while doing update_attributes! sets the value to nil HOT 3
- Rails 3.2.22.2 app fails to start: uninitialized constant Delocalize::DelocalizableParameters HOT 10
- Number parser failing with i18n fallbacks HOT 1
- Different structure of params in Rails 5 HOT 9
- Demo application not available HOT 5
- Are the rails_ext files needed?
- Regular expression for date time format does not escape regexp sensitive characters
- New controller-side paradigm not working for me HOT 10
- Regexp does not support many strptime formats HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delocalize.