idk man i think 22nd looks better than 22th

This commit is contained in:
Matthew Connelly 2015-03-09 20:51:16 +00:00
parent c0c818ec6e
commit eada88a4fe
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ sub slugify {
sub timefmt { sub timefmt {
my ($epoch,$context)=@_; my ($epoch,$context)=@_;
$epoch=str2time $epoch if $epoch !~ /^[0-9]{10}$/; $epoch=str2time $epoch if $epoch !~ /^[0-9]{10}$/;
my $dsuffix = 'th'; $dsuffix = 'st' if strftime("%d",localtime $epoch) eq '01'; $dsuffix = 'nd' if strftime("%d",localtime $epoch) eq '02'; my $dsuffix = 'th'; $dsuffix = 'st' if strftime("%d",localtime $epoch) =~ /1$/; $dsuffix = 'nd' if strftime("%d",localtime $epoch) =~ /2$/;
return strftime "%A, %e$dsuffix %b. %Y", localtime $epoch if $context eq 'fancydate'; return strftime "%A, %e$dsuffix %b. %Y", localtime $epoch if $context eq 'fancydate';
return strftime "%Y-%m-%dT%H:%M%z",localtime $epoch if $context eq 'datetime'; return strftime "%Y-%m-%dT%H:%M%z",localtime $epoch if $context eq 'datetime';
return strftime "%Y-%m",localtime $epoch if $context eq 'writepost'; return strftime "%Y-%m",localtime $epoch if $context eq 'writepost';