Fmt.setTemplate(new TextData("m/yyyy")); //$NON-NLS-1$
TextData FirstOfMonthText = new TextData("1/"); //$NON-NLS-1$
FirstOfMonthText.concat( Fmt.formatDate(DateInput) );
Fmt.setTemplate(new TextData("d/m/yyyy"));
DateTimeData FirstOfMonth = Fmt.decodeDate(FirstOfMonthText);
int DateStart = FirstOfMonth.dayOfWeek();
// Find out how many days are there in this month
// Note that we need to deal with leap year
int DateEnd = 0;