protected DateFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) { super(id, name, model); fmt = datePattern == null ? SyncopeConsoleSession.get().getDateFormat() : FastDateFormat.getInstance(datePattern); }
@Override public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) { IModel<?> date = getDataModel(rowModel); String convertedDate = ""; if (date.getObject() instanceof Date) { convertedDate = SyncopeConsoleSession.get().getDateFormat().format(date.getObject()); } item.add(new Label(componentId, convertedDate)); } }
@Override public void populateItem( final Item<ICellPopulator<AccessTokenTO>> cellItem, final String componentId, final IModel<AccessTokenTO> model) { JwsJwtCompactConsumer consumer = new JwsJwtCompactConsumer(model.getObject().getBody()); cellItem.add(new Label(componentId, SyncopeConsoleSession.get().getDateFormat().format( new Date(consumer.getJwtClaims().getIssuedAt())))); } });
public ProgressesPanel(final String id, final Date lastUpdate, final List<ProgressBean> progressBeans) { super(id); add(new Label("lastUpdate", SyncopeConsoleSession.get().getDateFormat().format(lastUpdate))); ListView<ProgressBean> progresses = new ListView<ProgressBean>("progresses", progressBeans) { private static final long serialVersionUID = -9180479401817023838L; @Override protected void populateItem(final ListItem<ProgressBean> item) { item.add(new ProgressPanel("progress", item.getModelObject())); } }; progresses.setOutputMarkupId(true); add(progresses); }
@Override public String getObject() { return model.getObject() == null ? "" : SyncopeConsoleSession.get().getDateFormat().format((Date) model.getObject()); }
? SyncopeConsoleSession.get().getDateFormat().format(sysInfoTO.getCreationDate()) : ""))); ? SyncopeConsoleSession.get().getDateFormat().format(sysInfoTO.getLastChangeDate()) : "")));
: SyncopeConsoleSession.get().getDateFormat().format(userTO.getChangePwdDate())))); : SyncopeConsoleSession.get().getDateFormat().format(userTO.getLastLoginDate())))); : SyncopeConsoleSession.get().getDateFormat().format(userTO.getTokenExpireTime()))));
private <T extends AbstractHistoryConf> Map<String, String> getDropdownNamesMap(final List<T> historyConfTOs) { Map<String, String> historyConfMap = new LinkedHashMap<>(); String current = null; for (T historyConf : historyConfTOs) { if (historyConf.getCreation() == null) { current = historyConf.getKey(); } else { historyConfMap.put(historyConf.getKey(), historyConf.getCreator() + " - " + SyncopeConsoleSession.get().getDateFormat().format( historyConf.getCreation()) + " - " + historyConf.getKey()); } } if (current != null) { historyConfMap.put(current, getString("current")); } return historyConfMap; }