Skip to content

Commit

Permalink
bug phpmyadmin#4231 DATE columns quick edit decrement by one day
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Delisle <[email protected]>
  • Loading branch information
meirg authored and Marc Delisle committed Jan 15, 2014
1 parent ab048da commit 1a9efd7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions js/makegrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,20 +989,19 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
) {
$input_field.val(current_datetime_value);
} else {
var date;
var date = new Date(
current_datetime_value.substring(0, 4),
parseInt(current_datetime_value.substring(5, 7)) - 1,
parseInt(current_datetime_value.substring(8, 10))
);
if (current_datetime_value.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6}$/)) {
date = new Date(current_datetime_value.substring(0, 10));
var hour = current_datetime_value.substring(11, 13);
var min = current_datetime_value.substring(14, 16);
var sec = current_datetime_value.substring(17, 19);
var milli = current_datetime_value.substring(20, 23);
var micro = current_datetime_value.substring(23);
date.setHours(hour, min, sec, milli);
date.setMicroseconds(micro);
var day = current_datetime_value.substring(8, 10);
date.setDate(day);
} else {
date = new Date(current_datetime_value);
}
$editArea.datetimepicker('setDate', date);
}
Expand Down

0 comments on commit 1a9efd7

Please sign in to comment.