[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; + } } } --------------------------------------------------------------------------------
no subject
Well, when it comes to presentation on a web site, I'd prefer human readable over ISO. I think seeing "Nov 21" flows more naturally than "XXXX-11-12".
In the case of data designed to be consumed by machines (FOAF, Atom, RSS, OPML, etc) then I totally agree and think we should use the ISO standards for date presentation.
no subject
I don't know how a non-US/non-anglophone crowd would feel about the matter, nor how relevant that is to your decisions.
You've understood my suggestion and considered it on its merit; my goal is accomplished. Thank you.
I'd be happy to continue the discussion if there's more to be had, of course.