TrendController { protected Long pitToJsDate(PointInTime pit) { if (pit == null || pit.getPrecision().compareTo(Precision.DATE) < 0) return null; return pit.promote().getCenter().toLocalDateTime().toDateTime().getMillis(); }  @Autowired void setLinkService(ILinkService linkService); @Autowired void setGenericPatientObjectDao(IGenericPatientObjectDAO genericPatientObjectDao); @RequestMapping(value = "/vpr/trend/**", method = RequestMethod.GET, params = "format=xml") String renderXml(HttpServletRequest request); @RequestMapping(value = "/vpr/trend/**", method = RequestMethod.GET, params = "format=json") ModelAndView renderJson(HttpServletRequest request); @RequestMapping(value = "/vpr/trend/**", method = RequestMethod.GET, params = "format=extjs") @ResponseBody String renderExtJs(@RequestParam("format") String format, HttpServletRequest request); static final String LAB_INDEX; static final String VITAL_INDEX; }
@Test public void testPitToJsDate() throws Exception { DateTime t = new DateTime(2001, 10, 22, 12, 0, 0, 0); assertThat(tc.pitToJsDate(new PointInTime(2001, 10, 22)), is(t.getMillis())); assertThat(tc.pitToJsDate(new PointInTime(2001, 10)), nullValue()); }