New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Formats Are Not Working #128
Comments
HI @scarrick68, if that helps, we did it by passing the format like this: local_time(@date_time, :time_with_tz) and specifying the format in our en:
time:
formats:
time_with_tz: "%H:%Mh %Z" |
Ah I see what happened. Sorry this is confusing, but rails helpers (like See line 55 here: local_time/app/helpers/local_time_helper.rb Lines 45 to 57 in 7b60d1d
Changing this is not trivial. Perhaps the action item here is adding a note to the readme saying that default values shouldn't be changed as it won't behave as one might expect. I'll look into it. |
Actually, I'm going to reopen so we remember to document this somehow |
Done in 6294194 For the time being, I'd only recommend using the i18n configuration after understanding which helpers use our Lines 2 to 3 in 7013aa9
"default" is admittedly a confusing choice of name here. Might revisit later. |
I am trying to set a default DateTime format for my app, so I did this in a JS file and included it into my application.js
I printed in the console and see the updated default format, but all of my DateTimes still show in the original default format. I am only interested in DateTime. I set the default on all of them just in case I was passing an unexpected type.
I called local_time in the view like this with :my_format being added to the formats instead of overriding default:
The text was updated successfully, but these errors were encountered: