Bug 14985: dbms expects a iso formatted date

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2015-11-11 14:26:51 +00:00 committed by Tomas Cohen Arazi
parent 7aabe91749
commit 9180389045
2 changed files with 2 additions and 2 deletions

View file

@ -1157,7 +1157,7 @@ sub ModReserve {
if ( defined( $suspend_until ) ) {
if ( $suspend_until ) {
$suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until ), dateonly => 1 }); };
$suspend_until = eval { output_pref( { dt => dt_from_string( $suspend_until ), dateonly => 1, dateformat => 'iso' }); };
$dbh->do("UPDATE reserves SET suspend = 1, suspend_until = ? WHERE reserve_id = ?", undef, ( $suspend_until, $reserve_id ) );
} else {
$dbh->do("UPDATE reserves SET suspend_until = NULL WHERE reserve_id = ?", undef, ( $reserve_id ) );

View file

@ -137,7 +137,7 @@ ModReserve({
$reserve = GetReserve( $reserve_id );
ok( $reserve->{'priority'} eq '4', "Test GetReserve(), priority changed correctly" );
ok( $reserve->{'suspend'}, "Test GetReserve(), suspend hold" );
ok( $reserve->{'suspend_until'} eq '2013-01-01 00:00:00', "Test GetReserve(), suspend until date" );
is( $reserve->{'suspend_until'}, '2013-01-01 00:00:00', "Test GetReserve(), suspend until date" );
ToggleSuspend( $reserve_id );
$reserve = GetReserve( $reserve_id );