You've opened this page
.
PrimeFaces Extensions was first released
.
The next month is
.
Source
<p>
You've opened this page
<pe:timeAgo value="#{basicTimeAgoController.created}"
titlePattern="MMMM dd yyyy hh:mm a" style="font-weight:bold" />.
</p>
<p>
PrimeFaces Extensions was first released
<pe:timeAgo value="#{basicTimeAgoController.firstRelease}"
titlePattern="MMMM dd yyyy" style="font-weight:bold"/>.
</p>
<p>
The next month is
<pe:timeAgo value="#{basicTimeAgoController.nextMonth}"
titlePattern="MMMM dd yyyy" style="font-weight:bold"/>.
</p>
@Named
@ViewScoped
public class BasicTimeAgoController implements Serializable {
private static final long serialVersionUID = 1L;
private final OffsetDateTime created = OffsetDateTime.now();
private final LocalDateTime firstRelease = LocalDate.of(2012, Month.JANUARY, 23).atStartOfDay();
private final LocalDateTime nextMonth = LocalDateTime.now()
.plusMonths(1)
.withDayOfMonth(1)
.truncatedTo(ChronoUnit.DAYS);
public OffsetDateTime getCreated() {
return created;
}
public LocalDateTime getFirstRelease() {
return firstRelease;
}
public LocalDateTime getNextMonth() {
return nextMonth;
}
}