// Setup the field's values
if (dcInput.isRepeatable() || dcValues.length > 1)
{
for (Metadatum dcValue : dcValues)
{
DCDate dcDate = new DCDate(dcValue.value);
year.addInstance().setValue(String.valueOf(dcDate.getYear()));
month.addInstance().setOptionSelected(dcDate.getMonth());
day.addInstance().setValue(String.valueOf(dcDate.getDay()));
fullDate.addInstance().setValue(dcDate.toString());
}
}
else if (dcValues.length == 1)
{
DCDate dcDate = new DCDate(dcValues[0].value);
year.setValue(String.valueOf(dcDate.getYear()));
month.setOptionSelected(dcDate.getMonth());
// Check if the day field is not specified, if so then just
// put a blank value in instead of the weird looking -1.
if (dcDate.getDay() == -1)
{
day.setValue("");
}
else
{
day.setValue(String.valueOf(dcDate.getDay()));
}
}
}