[livejournal] r22716: LJSUP-12917: Add RESERVED and INCOMING t...
Committer: nnikulochkina
LJSUP-12917: Add RESERVED and INCOMING tabs to user wallet pageU trunk/cgi-bin/LJ/TimeUtil.pm
Modified: trunk/cgi-bin/LJ/TimeUtil.pm
===================================================================
--- trunk/cgi-bin/LJ/TimeUtil.pm 2012-08-22 06:59:08 UTC (rev 22715)
+++ trunk/cgi-bin/LJ/TimeUtil.pm 2012-08-22 08:25:08 UTC (rev 22716)
@@ -369,9 +369,10 @@
=cut
sub fancy_time_format {
- my ( $class, $timestamp, $precision, $timezone ) = @_;
+ my ( $class, $timestamp, $precision, $timezone, $opts ) = @_;
$precision ||= 'sec';
$timezone ||= 'UTC';
+ $opts ||= {};
# DateTime heavily uses Params::Validate to validate incoming parameters,
# but it gives significant overhead
@@ -382,10 +383,17 @@
'time_zone' => $timezone,
);
- my $month_code = lc LJ::Lang::month_short( $dt->month );
- my $day_month = LJ::Lang::ml( 'esn.month.day_' . $month_code,
- { 'day' => $dt->day } );
+ my $day_month;
+ if ($opts->{mount_short}) {
+ my $month_code = LJ::Lang::month_short_langcode($dt->month);
+ $day_month = $dt->day . " " . LJ::Lang::ml($month_code);
+ } else {
+ my $month_code = lc LJ::Lang::month_short( $dt->month );
+ $day_month = LJ::Lang::ml( 'esn.month.day_' . $month_code,
+ { 'day' => $dt->day } );
+ }
+
my $ret = $day_month . ' ' . $dt->year;
return $ret if $precision eq 'day';
