[dw-free] human-friendly profile birthdays
[commit: http://hg.dwscoalition.org/dw-free/rev/21c6be8bb177]
http://bugs.dwscoalition.org/show_bug.cgi?id=1121
Display birthday on profile as 'Mon DD' or 'Mon DD, YYYY' instead of the
confusing 'MM-DD'.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1121
Display birthday on profile as 'Mon DD' or 'Mon DD, YYYY' instead of the
confusing 'MM-DD'.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/DW/Logic/ProfilePage.pm
-------------------------------------------------------------------------------- diff -r 1c97618605a6 -r 21c6be8bb177 cgi-bin/DW/Logic/ProfilePage.pm --- a/cgi-bin/DW/Logic/ProfilePage.pm Sun May 10 05:58:55 2009 +0000 +++ b/cgi-bin/DW/Logic/ProfilePage.pm Sun May 10 06:13:37 2009 +0000 @@ -377,7 +377,16 @@ sub _basic_info_birthday { my $bdate = $u->prop( 'bdate' ); if ( $bdate && $bdate ne "0000-00-00" ) { $ret->[0] = LJ::Lang::ml( '.label.birthdate' ); - $ret->[1] = $u->bday_string; + my ($year, $mon, $day) = split /-/, $bdate; + my $moname = LJ::Lang::month_short_ml( $mon ); + $day += 0; + if ( $u->bday_string =~ /\d+-\d+-\d+/ ) { + $ret->[1] = "$moname $day, $year"; + } elsif ( $u->bday_string =~ /\d+-\d+/ ) { + $ret->[1] = "$moname $day"; + } else { + $ret->[1] = $u->bday_string; + } } } --------------------------------------------------------------------------------