(?<year>\d{4})
|xms;
}
+ elsif ( $date_format eq 'dmydot' ) {
+ # dmydot format is "dd.mm.yyyy[ hh:mm:ss]"
+ $regex = qr|
+ (?<day>\d{2})
+ .
+ (?<month>\d{2})
+ .
+ (?<year>\d{4})
+ |xms;
+ }
elsif ( $date_format eq 'us' ) {
# us format is "mm/dd/yyyy[ hh:mm:ss]"
$regex = qr|
? $dt->strftime("%d/%m/%Y")
: $dt->strftime("%d/%m/%Y $time");
}
+ elsif ( $pref =~ m/^dmydot/ ) {
+ $date = $dateonly
+ ? $dt->strftime("%d.%m.%Y")
+ : $dt->strftime("%d.%m.%Y $time");
+ }
+
elsif ( $pref =~ m/^us/ ) {
$date = $dateonly
? $dt->strftime("%m/%d/%Y")
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'),
-('dateformat','us','metric|us|iso','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','Choice'),
+('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'),
('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'),
('decreaseLoanHighHolds',NULL,'','Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue','YesNo'),
('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'),
use DateTime::TimeZone;
use C4::Context;
-use Test::More tests => 59;
+
+use Test::More tests => 60;
+
use Test::MockModule;
use Test::Warn;
use Time::HiRes qw/ gettimeofday /;
is( ref($dt), '', '31/01/2015 is not a correct date in us format' );
$dt = dt_from_string( '01/01/2015', 'us' );
is( ref($dt), 'DateTime', '01/01/2015 is a correct date in us format' );
+$dt = dt_from_string( '01.01.2015', 'dmydot' );
+is( ref($dt), 'DateTime', '01.01.2015 is a correct date in dmydot format' );
# default value for hh and mm is 00:00