solved Birthdate with year

alt=
TomB
@tomb
3 years ago
10 posts
Hello everyone,
I have a question about the correct output of the birthdate. We changed the default setting that exists since version v.5.4.0 (exclude_year =false) and used the jrCore_date_birthday_format() in our template. This works fine for all dates after the year 1970, but for the years before there is no output at all. (The dates in the database are all correct)
Is this a known issue? And does anyone know how to fix it?
Thank you for your help.
updated by @tomb: 09/07/21 02:43:05AM
paul
@paul
3 years ago
4,326 posts
I'm guessing its something to do with 'Unix Time' starting at 1/1/1970 and the module code not handling years before this time. I'll check it out and let you know.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
alt=
TomB
@tomb
3 years ago
10 posts
Hi Paul,
we found a possible solution: In the smarty.php we used the template {$item.user_birthdate|jrCore_date_birthday_format:"%d %b %Y"}, which leads to the wanted result. Before that we used %d. %b, which resulted in the default selected case jrCore_default_time, that probably canĀ“t output the correct date.
paul
@paul
3 years ago
4,326 posts
Glad you have it sorted. The Jamroom Birthday module hasn't been looked at in a while. I'll check it out to see if it can be updated.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
alt=
TomB
@tomb
3 years ago
10 posts
Is it possible to implement an European format for the birthdate, like %d. %B %Y or %d. %m. %Y as fourth or fifth case?
Thank you
paul
@paul
3 years ago
4,326 posts
TomB:
Is it possible to implement an European format for the birthdate, like %d. %B %Y or %d. %m. %Y as fourth or fifth case?
Thank you

So more options in the Core=>Date and Time=>Date Format select field?


--
Paul Asher - JR Developer and System Import Specialist
alt=
TomB
@tomb
3 years ago
10 posts
Hi Paul,
it would be sufficient if the function jrCore_date_birthday_format() interprets one of the formats like %d %b %Y without jumping into the datetime function. In the European standard, the interpretation would be identical to %d %b %Y, but with ".".
The error seems to be caused by the fact that the datetime function cannot handle negative timestamps. Fixing this might be more extensive than adding another option to jrCore_date_birthday_format.
paul
@paul
3 years ago
4,326 posts
Got it. If a user has entered a birth year that is pre 1970, the birthday doesn't get shown.
As you say above, the jrCore_date_birthday_format smarty modifier function needs to handle this situation, along with any (euro) formats that you may specify.
I'll get it sorted.
Thanks


--
Paul Asher - JR Developer and System Import Specialist

Tags