001    package market;
002    
003    import java.text.SimpleDateFormat;
004    import java.util.Calendar;
005    import java.util.Date;
006    
007    
008    /**
009     * The time for the market.
010     */
011    public class CalendarTime extends sale.CalendarTime {
012    
013        public CalendarTime() {
014            super(Conversions.createToday().getTime().getTime());
015        }
016    
017        /**
018         * @return the current time.
019         */
020        public Object getTime() {
021            Date d = (Date)super.getTime();
022            SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
023            String datString = sdf.format(d);
024            return Conversions.stringToCalendar(datString);
025        }
026    
027        /**
028         * Sets a new time.
029         * @param oTime the time to be set.
030         * @throws IllegalArgumentException
031         */
032        public void setTime(Object oTime) throws IllegalArgumentException {
033            super.setTime(((Calendar)oTime).getTime());
034        }
035    }