Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import of MSTRAT/DateTime-Format-Human-Duration-0.4 from CPAN.
gitpan-cpan-distribution: DateTime-Format-Human-Duration gitpan-cpan-version: 0.4 gitpan-cpan-path: MSTRAT/DateTime-Format-Human-Duration-0.4.tar.gz gitpan-cpan-author: MSTRAT gitpan-cpan-maturity: released
- Loading branch information
Showing
9 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package DateTime::Format::Human::Duration::Locale::nb; | ||
# XXX: this isn't really NB locale, I just cheat the system. | ||
# | ||
sub get_human_span_from_units_array { | ||
my ($years, $months, $weeks, $days, $hours, $minutes, $seconds, $nanoseconds, $args_hr) = @_; # note: has no negative numbers | ||
if ($years) { | ||
$s = $years . "y"; | ||
} elsif ($months) { | ||
$s = $months . "mo"; | ||
} elsif ($weeks) { | ||
$s = $weeks . "w"; | ||
} elsif ($days) { | ||
$s = $days . "d"; | ||
} elsif ($hours) { | ||
$s = $hours . "h"; | ||
} elsif ($minutes) { | ||
$s = $minutes . "mi"; | ||
} elsif ($seconds) { | ||
$s = "moments"; | ||
} | ||
return $s; | ||
} | ||
|
||
1; |