package com.inepex.ineForm.client.form.widgets.datetime;

import com.google.gwt.user.datepicker.client.CalendarModel;
import com.google.gwt.user.datepicker.client.DatePicker;
import com.google.gwt.user.datepicker.client.DefaultCalendarView;
import com.google.gwt.user.datepicker.client.DefaultMonthSelector;
import com.inepex.ineForm.client.i18n.DateI18nHelper;

public class I18nDatePicker extends DatePicker {
	
	public I18nDatePicker() {
		super(new DefaultMonthSelector(), new DefaultCalendarView(), new CustomFormatCalendarModel());
	}
	
	private static class CustomFormatCalendarModel extends CalendarModel {
		
		@Override
		public String formatDayOfWeek(int dayInWeek) {
			return DateI18nHelper.formatDayOfWeek(dayInWeek);
		}
		
		@Override
		@SuppressWarnings("deprecation")
		public String formatCurrentMonth() {
			return (getCurrentMonth().getYear()+1900)
					+". "
					+formatMonth(getCurrentMonth().getMonth());
		}
		
		public String formatMonth(int month) {
			return DateI18nHelper.formatMonth(month);			
		}
	}
	
}
@@ -301,16 +301,76 @@
 lector;%0A
+import com.google.gwt.user.datepicker.client.MonthSelector;%0A
 import c
@@ -602,14 +602,95 @@
 %09%0A%09p
-rivate
+ublic MonthSelector getMonthSelectorPublic()%7B%0A%09%09return getMonthSelector();%0A%09%7D%0A%09%0A%09public
  sta

add getMonthSelector to I18nDatePicker