1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Date型の日付をjsp内でフォーマット指定して表示する

Posted at

画面にデータを渡す時点ではDate型だが、jspを描画時にdate→String(しかもフォーマット指定)に変換して表示する方法。

HTMLの<input type="date">のvalueはyyyy-MM-ddのフォーマットで値を渡してやらないといけないみたいです。


<input type="date" class="w120" value="<fmt:formatDate value="${mealCancel.mealCancelDate}" pattern="yyyy-MM-dd" />">


単純でした。valueにjstlの<fmt:formatDate>を埋め込んで、フォーマットを指定すると上手くいきました:relaxed:
楽チン〜:point_up_tone1:

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?