mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Add support for year and complete short date formats
i.e. can now return 2024 and Thursday, April 1
This commit is contained in:
@@ -2224,7 +2224,9 @@ if (!$@ && $] > 5.011) {
|
||||
$data->{'complete'} .= "$_ "
|
||||
}
|
||||
};
|
||||
$data->{'year'} = DateTime->from_epoch(locale => $locale_name_loaded, epoch => $secs, time_zone => $tz)->strftime("%Y");
|
||||
$data->{'complete'} =~ s/(\d+):(\d+):(\d+)(.*?)/$1:$2$4/;
|
||||
($data->{'complete_short'} = $data->{'complete'}) =~ s/(.*?)([\s\,]*\Q$data->{'year'}\E.*)/$1/;
|
||||
|
||||
if ($opts->{'get'}) {
|
||||
return $data->{$opts->{'get'}};
|
||||
|
||||
Reference in New Issue
Block a user