Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:yukoff:openSUSE:Leap:42.1:Backports
perl-Date-Tiny
Date-Tiny-format.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Date-Tiny-format.patch of Package perl-Date-Tiny
Index: lib/Date/Tiny.pm =================================================================== --- lib/Date/Tiny.pm.orig +++ lib/Date/Tiny.pm @@ -134,6 +134,8 @@ =cut +my $format_string = "%d/%m/%Y"; + sub new { my $class = shift; bless { @_ }, $class; @@ -155,8 +157,9 @@ =cut sub now { - my @t = localtime time; - shift->new( + my $class = shift; + my @t = localtime time; + $class->new( year => $t[5] + 1900, month => $t[4] + 1, day => $t[3], @@ -217,6 +220,23 @@ } +sub set_format { + $format_string = $_[1]; +} + + +sub format { + return $_[0]->year + if(!defined $_[0]->day && !defined $_[0]->month); + my $res = $format_string; + my $day = $_[0]->day; + my $month = $_[0]->month; + my $year = $_[0]->year; + $res =~ s/%d/$day/; + $res =~ s/%m/$month/; + $res =~ s/%Y/$year/; + return $res; +}
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor