use of org.onebusaway.transit_data.model.service_alerts.TimeRangeBean in project onebusaway-application-modules by camsys.
the class ServiceAlertAction method setStartDate.
public void setStartDate(Date startDate) {
List<TimeRangeBean> publicationWindows = _model.getPublicationWindows();
if (publicationWindows == null) {
publicationWindows = new ArrayList<TimeRangeBean>();
_model.setPublicationWindows(publicationWindows);
}
if (publicationWindows.isEmpty()) {
publicationWindows.add(new TimeRangeBean());
}
TimeRangeBean timeRangeBean = publicationWindows.get(0);
if (startDate != null) {
timeRangeBean.setFrom(startDate.getTime());
} else {
timeRangeBean.setFrom(0);
}
}
use of org.onebusaway.transit_data.model.service_alerts.TimeRangeBean in project onebusaway-application-modules by camsys.
the class ServiceAlertEditAction method setStartDate.
public void setStartDate(Date startDate) {
List<TimeRangeBean> publicationWindows = _model.getPublicationWindows();
if (publicationWindows == null) {
publicationWindows = new ArrayList<TimeRangeBean>();
_model.setPublicationWindows(publicationWindows);
}
if (publicationWindows.isEmpty()) {
publicationWindows.add(new TimeRangeBean());
}
TimeRangeBean timeRangeBean = publicationWindows.get(0);
if (startDate != null) {
timeRangeBean.setFrom(startDate.getTime());
} else {
timeRangeBean.setFrom(0);
}
}
use of org.onebusaway.transit_data.model.service_alerts.TimeRangeBean in project onebusaway-application-modules by camsys.
the class ServiceAlertEditAction method getEndDate.
public String getEndDate() {
List<TimeRangeBean> publicationWindows = _model.getPublicationWindows();
if (publicationWindows == null || publicationWindows.isEmpty() || publicationWindows.get(0).getTo() == 0) {
return null;
}
Date date = new Date(publicationWindows.get(0).getTo());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
}
use of org.onebusaway.transit_data.model.service_alerts.TimeRangeBean in project onebusaway-application-modules by camsys.
the class ServiceAlertEditAction method setEndDate.
public void setEndDate(Date endDate) {
List<TimeRangeBean> publicationWindows = _model.getPublicationWindows();
if (publicationWindows == null) {
publicationWindows = new ArrayList<TimeRangeBean>();
_model.setPublicationWindows(publicationWindows);
}
if (publicationWindows.isEmpty()) {
publicationWindows.add(new TimeRangeBean());
}
TimeRangeBean timeRangeBean = publicationWindows.get(0);
if (endDate != null) {
timeRangeBean.setTo(endDate.getTime());
} else {
timeRangeBean.setTo(0);
}
}
use of org.onebusaway.transit_data.model.service_alerts.TimeRangeBean in project onebusaway-application-modules by camsys.
the class ServiceAlertEditAction method getStartDate.
public String getStartDate() {
List<TimeRangeBean> publicationWindows = _model.getPublicationWindows();
if (publicationWindows == null || publicationWindows.isEmpty() || publicationWindows.get(0).getFrom() == 0) {
return null;
}
Date date = new Date(publicationWindows.get(0).getFrom());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
}
Aggregations