mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-05-10 06:13 am

[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 [personal profile] kareila.

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;
+            }
         }
     }
 
--------------------------------------------------------------------------------
marcmagus: Me playing cribbage in regency attire (Default)

[personal profile] marcmagus 2009-05-10 06:09 pm (UTC)(link)
While the ISO is intended to be used for human readable dates as well as machine-processed, I can't say I completely disagree with you. (I, personally, often prefer to use ISO for all purposes, but we're distinctly getting into the realm of aesthetic here.)

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.