Skip to content

Commit

Permalink
Convert Calendar to Date
Browse files Browse the repository at this point in the history
issue imixs#347
  • Loading branch information
rsoika committed Feb 19, 2018
1 parent 89d5dcd commit dd65be2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -707,6 +708,15 @@ private void setItemValue(String itemName, Object itemValue, boolean append) {
@SuppressWarnings("rawtypes")
private boolean validateItemValue(Object itemValue) {

if (itemValue==null) {
return true;
}

// convert Calendar instance into Date! issue #52
if (itemValue instanceof Calendar) {
itemValue=((Calendar)itemValue).getTime();
}

// array?
if (itemValue != null && itemValue.getClass().isArray()) {
for (int i = 0; i < Array.getLength(itemValue); i++) {
Expand Down

0 comments on commit dd65be2

Please sign in to comment.