<s> from ApplicationConstants import Notification <EOL> from pyjamas . ui . HorizontalPanel import HorizontalPanel <EOL> from pyjamas . ui . Button import Button <EOL> from pyjamas . ui . TextBox import TextBox <EOL> import time <EOL> class DatePicker ( HorizontalPanel ) : <EOL> time = None <EOL> dateBox = None <EOL> def __init__ ( self ) : <EOL> try : <EOL> HorizontalPanel . __init__ ( self ) <EOL> self . time = time . time ( ) <EOL> self . date = None <EOL> self . prevDayBtn = Button ( "<STR_LIT>" , self . onPrevDay ) <EOL> self . nextDayBtn = Button ( "<STR_LIT>" , self . onNextDay ) <EOL> self . prevWeekBtn = Button ( "<STR_LIT>" , self . onPrevWeek ) <EOL> self . nextWeekBtn = Button ( "<STR_LIT>" , self . onNextWeek ) <EOL> self . dateBox = TextBox ( ) <EOL> self . dateBox . setMaxLength ( <NUM_LIT:10> ) <EOL> self . dateBox . setVisibleLength ( <NUM_LIT:10> ) <EOL> self . add ( self . prevWeekBtn ) <EOL> self . add ( self . prevDayBtn ) <EOL> self . add ( self . dateBox ) <EOL> self . add ( self . nextDayBtn ) <EOL> self . add ( self . nextWeekBtn ) <EOL> except : <EOL> raise <EOL> def onPrevDay ( self , sender ) : <EOL> self . time -= <NUM_LIT> <EOL> def onNextDay ( self , sender ) : <EOL> self . time += <NUM_LIT> <EOL> def onPrevWeek ( self , sender ) : <EOL> self . time -= <NUM_LIT:7> * <NUM_LIT> <EOL> def onNextWeek ( self , sender ) : <EOL> self . time += <NUM_LIT:7> * <NUM_LIT> <EOL> def displayDay ( self ) : <EOL> self . dateBox . setText ( time . strftime ( "<STR_LIT>" , time . localtime ( self . time ) ) ) <EOL> self . date = time . strftime ( "<STR_LIT>" , time . localtime ( self . time ) ) </s>
