I18n.l date displays the month wrong by +one

72 views
Skip to first unread message

Torsten Rüger

unread,
Jan 9, 2013, 3:27:34 PM1/9/13
to rails...@googlegroups.com
I have an object with a created_at date and if i just display (to_date.to_s) that in a template, it displays correctly as "2013-01-09" 

But, if i use i18n as in <%= I18n.l object.created_at.to_date %>  it displays as 9. helmikuuta 2013  (february)
(that's finish locale, but i just checked i have the latest)

What is even more interesting is that this behavior only occurs after a page refresh and hence after. The first time a page shows it is correct !
And in the console it is always correct.

I am quite sure this is not a i18n bug, but i would appreciate any help in finding it. Ie what kind of calls can be done to make this behavior happen, or could it be some locale file anyway that only gets loaded after the page shows.

Actually i just noticed by accident that touching the rails locale file will make it show the correct date once again in development. I guess the fi.yml gets reloaded but then overwritten again. How oh how.

The template code has not changed and it did work fine with rails 3.2.9, before upgrading rails to 3.2.11 .

much obliged

Torsten 

top 3.

unread,
Aug 9, 2013, 12:21:54 AM8/9/13
to rails...@googlegroups.com
منتديات توب عرب للمبدعين احساس منتديات عامة
افضل المنتديات العربية
http://www.top3rab.mrsaal.com
http://www.top3rab.mrsaal.com/forums/toparab10
http://www.top3rab.mrsaal.com/forums/toparab14
http://www.top3rab.mrsaal.com/forums/toparab41
http://www.top3rab.mrsaal.com/forums/toparab47
http://www.top3rab.mrsaal.com/forums/toparab54
http://www.top3rab.mrsaal.com/forums/toparab49
http://www.top3rab.mrsaal.com/forums/toparab49
http://www.top3rab.mrsaal.com/forums/toparab48
http://www.top3rab.mrsaal.com/forums/toparab48
http://www.top3rab.mrsaal.com/forums/toparab50
http://www.top3rab.mrsaal.com/forums/toparab51
http://www.top3rab.mrsaal.com/forums/toparab52
http://www.top3rab.mrsaal.com/forums/toparab53
http://www.top3rab.mrsaal.com/forums/toparab53
http://www.top3rab.mrsaal.com/forums/toparab55
http://www.top3rab.mrsaal.com/forums/toparab56
http://www.top3rab.mrsaal.com/forums/toparab57
http://www.top3rab.mrsaal.com/forums/toparab57
http://www.top3rab.mrsaal.com/forums/toparab58
http://www.top3rab.mrsaal.com/forums/toparab59
http://www.top3rab.mrsaal.com/forums/toparab60
http://www.top3rab.mrsaal.com/forums/toparab61
http://www.top3rab.mrsaal.com/forums/toparab62
http://www.top3rab.mrsaal.com/forums/toparab62
http://www.top3rab.mrsaal.com/forums/toparab64
http://www.top3rab.mrsaal.com/forums/toparab65
http://www.top3rab.mrsaal.com/forums/toparab66
http://www.top3rab.mrsaal.com/forums/toparab67
http://www.top3rab.mrsaal.com/forums/toparab67
http://www.top3rab.mrsaal.com/forums/toparab68
http://www.top3rab.mrsaal.com/forums/toparab69
http://www.top3rab.mrsaal.com/forums/toparab69
http://www.top3rab.mrsaal.com/forums/toparab70/
http://www.top3rab.mrsaal.com/forums/toparab71
http://www.top3rab.mrsaal.com/forums/toparab72
http://www.top3rab.mrsaal.com/forums/toparab72
http://www.top3rab.mrsaal.com/forums/toparab73
http://www.top3rab.mrsaal.com/forums/toparab74
http://www.top3rab.mrsaal.com/forums/toparab75
http://www.top3rab.mrsaal.com/forums/toparab75
http://www.top3rab.mrsaal.com/forums/toparab75
http://www.top3rab.mrsaal.com/forums/toparab76
http://www.top3rab.mrsaal.com/forums/toparab76
http://www.top3rab.mrsaal.com/forums/toparab77
http://www.top3rab.mrsaal.com/forums/toparab78
http://www.top3rab.mrsaal.com/forums/toparab79
http://www.top3rab.mrsaal.com/forums/toparab79
http://www.top3rab.mrsaal.com/forums/toparab80
http://www.top3rab.mrsaal.com/forums/toparab80
http://www.top3rab.mrsaal.com/forums/toparab81
http://www.top3rab.mrsaal.com/forums/toparab81
http://www.top3rab.mrsaal.com/forums/toparab81
http://www.top3rab.mrsaal.com/forums/toparab82
http://www.top3rab.mrsaal.com/forums/toparab82
http://www.top3rab.mrsaal.com/forums/toparab82
http://www.top3rab.mrsaal.com/forums/toparab42
http://www.top3rab.mrsaal.com/forums/toparab43
http://www.top3rab.mrsaal.com/forums/toparab43
http://www.top3rab.mrsaal.com/forums/toparab45
http://www.top3rab.mrsaal.com/forums/toparab46
http://www.top3rab.mrsaal.com/forums/toparab44
http://www.top3rab.mrsaal.com/forums/toparab44

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages