public void setEndDate ( Date dateEnd ) { try { dateEnd = m_productItem . getEndDate ( ) ; // Date as it appears on the screen Date timeNew = m_productItem . setRemoteEndDate ( dateEnd ) ; if ( ! timeNew . equals ( dateEnd ) ) { Date dateStart = m_productItem . getStartDate ( ) ; String [ ] rgstrMeals = m_productItem . getMealCache ( dateStart , dateEnd ) ; m_productItem . setCacheData ( null , timeNew , null , rgstrMeals ) ; // Usually, you would have to update the data, but removing the icon in the next step will do this. } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } try { Thread . sleep ( 2000 ) ; // Sleep for 2 seconds } catch ( InterruptedException e ) { } m_productItem . setStatus ( m_productItem . getStatus ( ) & ~ ( 1 << 1 ) ) ; }
Set the new end date for the remote item .