dimanche 30 mai 2021

DateTime-local in thymeleaf and Spring boot

Entity : 

@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")

@Column(name="DATE_DEBUT_SERVICE")

private Date dateDebutService;


@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")

@Column(name="DATE_FIN_SERVICE")

private Date dateFinService;


HTML Form :
<small class="form-text text-muted">Date Début</small>
<input type="datetime-local" name="dateDebutService" id="dateDebutService" th:field="*{dateDebutService}" class="form-control form-control-sm"/>

Aucun commentaire:

Enregistrer un commentaire