@Test public void shouldTrimHoursFromReceivedDate() throws Exception { OrderPOD orderPod = new OrderPOD(); orderPod.setReceivedDate(DateUtils.parseDate("01-09-12 05:30:00", new String[]{"dd-MM-yy HH:mm:ss"})); assertThat(orderPod.trimHoursFromDate(orderPod.getReceivedDate()), is(DateUtils.parseDate("01-09-12 00:00:00", new String[]{"dd-MM-yy HH:mm:ss"}))); }
public Date trimHoursFromDate(Date receivedDate) throws ParseException { if (receivedDate == null) return null; SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); return dateFormatWithoutTime.parse(dateFormatWithoutTime.format(receivedDate)); }
OrderPOD extends BaseModel { public Date trimHoursFromDate(Date receivedDate) throws ParseException { if (receivedDate == null) return null; SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); return dateFormatWithoutTime.parse(dateFormatWithoutTime.format(receivedDate)); } }
OrderPOD extends BaseModel { public Date trimHoursFromDate(Date receivedDate) throws ParseException { if (receivedDate == null) return null; SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); return dateFormatWithoutTime.parse(dateFormatWithoutTime.format(receivedDate)); } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); }
OrderPOD extends BaseModel { public Date trimHoursFromDate(Date receivedDate) throws ParseException { if (receivedDate == null) return null; SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); return dateFormatWithoutTime.parse(dateFormatWithoutTime.format(receivedDate)); } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); void validate(); void fillPOD(Rnr requisition); void fillPODLineItems(List<? extends LineItem> lineItems); void copy(OrderPOD orderPOD); @JsonIgnore String getStringReceivedDate(); Date trimHoursFromDate(Date receivedDate); }
OrderPOD extends BaseModel { public Date trimHoursFromDate(Date receivedDate) throws ParseException { if (receivedDate == null) return null; SimpleDateFormat dateFormatWithoutTime = new SimpleDateFormat("dd/MM/yyyy"); return dateFormatWithoutTime.parse(dateFormatWithoutTime.format(receivedDate)); } OrderPOD(Long id);  OrderPOD(Long orderId, String orderNumber, Long userId); void validate(); void fillPOD(Rnr requisition); void fillPODLineItems(List<? extends LineItem> lineItems); void copy(OrderPOD orderPOD); @JsonIgnore String getStringReceivedDate(); Date trimHoursFromDate(Date receivedDate);  }