// specifies
getWidget().setShowISOWeekNumbers(
uidl.getBooleanAttribute(DateFieldConstants.ATTR_WEEK_NUMBERS)
&& getWidget().dts.getFirstDayOfWeek() == 1);
Resolution newResolution;
if (uidl.hasVariable("sec")) {
newResolution = Resolution.SECOND;
} else if (uidl.hasVariable("min")) {
newResolution = Resolution.MINUTE;
} else if (uidl.hasVariable("hour")) {
newResolution = Resolution.HOUR;
} else if (uidl.hasVariable("day")) {
newResolution = Resolution.DAY;
} else if (uidl.hasVariable("month")) {
newResolution = Resolution.MONTH;
} else {
newResolution = Resolution.YEAR;
}
// Remove old stylename that indicates current resolution
setWidgetStyleName(
getWidget().getStylePrimaryName()
+ "-"
+ VDateField.resolutionToString(getWidget()
.getCurrentResolution()), false);
getWidget().setCurrentResolution(newResolution);
// Add stylename that indicates current resolution
setWidgetStyleName(
getWidget().getStylePrimaryName()
+ "-"
+ VDateField.resolutionToString(getWidget()
.getCurrentResolution()), true);
final Resolution resolution = getWidget().getCurrentResolution();
final int year = uidl.getIntVariable("year");
final int month = (resolution.getCalendarField() >= Resolution.MONTH
.getCalendarField()) ? uidl.getIntVariable("month") : -1;
final int day = (resolution.getCalendarField() >= Resolution.DAY
.getCalendarField()) ? uidl.getIntVariable("day") : -1;
final int hour = (resolution.getCalendarField() >= Resolution.HOUR
.getCalendarField()) ? uidl.getIntVariable("hour") : 0;
final int min = (resolution.getCalendarField() >= Resolution.MINUTE
.getCalendarField()) ? uidl.getIntVariable("min") : 0;
final int sec = (resolution.getCalendarField() >= Resolution.SECOND
.getCalendarField()) ? uidl.getIntVariable("sec") : 0;
// Construct new date for this datefield (only if not null)
if (year > -1) {
getWidget().setCurrentDate(