no message
This commit is contained in:
18
js/date.js
Normal file
18
js/date.js
Normal file
@@ -0,0 +1,18 @@
|
||||
$(document).ready(function() {
|
||||
// ページロード時に現在時刻を取得してフォーマット
|
||||
var now = new Date();
|
||||
var formattedDate = now.getFullYear() + "-" +
|
||||
('0' + (now.getMonth() + 1)).slice(-2) + "-" +
|
||||
('0' + now.getDate()).slice(-2) + " " +
|
||||
('0' + now.getHours()).slice(-2) + ":" +
|
||||
('0' + now.getMinutes()).slice(-2) + ":" +
|
||||
('0' + now.getSeconds()).slice(-2);
|
||||
|
||||
// id="date"の要素に現在時刻を挿入
|
||||
$("#date").text(formattedDate);
|
||||
|
||||
// 投稿ボタンクリック時の処理
|
||||
$("#submitBtn").click(function() {
|
||||
$("#topicForm").submit(); // フォームをサブミット
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user