public String displayLocalDate(boolean showTime, Locale locale) { // forcibly truncate month name to 3 chars -- XXX FIXME? String monthName = getMonthName(getMonth(), locale); if (monthName.length() > 2) { monthName = monthName.substring(0, 3); } // display date and time if (showTime && granularity == DateGran.TIME) { return String.format("%d-%s-%4d %02d:%02d:%02d", getDay(), monthName, getYear(), getHour(), getMinute(), getSecond()); } else if (granularity == DateGran.YEAR) { return String.format("%4d", getYear()); } else if (granularity == DateGran.MONTH) { return String.format("%s-%4d", monthName, getYear()); } else { return String.format("%d-%s-%4d", getDay(), monthName, getYear()); } }
int currentYear = DCDate.getCurrent().getYear(); int i = currentYear;
int currentYear = DCDate.getCurrent().getYear(); int i = currentYear;
for (MetadataValue dcv : currentDateIssued) { if (dcv.getValue() != null && dcv.getValue().equalsIgnoreCase("today")) { DCDate issued = new DCDate(now.getYear(), now.getMonth(), now.getDay(), -1, -1, -1); itemService.addMetadata(c, item, dcv.getMetadataField(), dcv.getLanguage(), issued.toString()); } else if (dcv.getValue() != null) {
for (MetadataValue dcv : currentDateIssued) { if (dcv.getValue() != null && dcv.getValue().equalsIgnoreCase("today")) { DCDate issued = new DCDate(now.getYear(), now.getMonth(), now.getDay(), -1, -1, -1); itemService.addMetadata(c, item, dcv.getMetadataField(), dcv.getLanguage(), issued.toString()); } else if (dcv.getValue() != null) {