Skip to content

Instantly share code, notes, and snippets.

@hexagit
Last active October 10, 2019 07:51
Show Gist options
  • Save hexagit/60e948148fe81b1f810e7251be44ad48 to your computer and use it in GitHub Desktop.
Save hexagit/60e948148fe81b1f810e7251be44ad48 to your computer and use it in GitHub Desktop.
$(document).ready(function () {
// 日付を追加
const year = $("#Year");
const month = $("#Month");
const date = $("#Date");
for (var i = 2019; i <= 2024; i++) {
year.append('<option value="' + i + '">' + i + '</option>');
}
for (var i = 1; i <= 12; i++) {
month.append('<option value="' + i + '">' + i + '</option>');
}
for (var i = 1; i <= 31; i++) {
date.append('<option value="' + i + '">' + i + '</option>');
}
// 今日を設定
var today = new Date();
year.val(today.getFullYear());
month.val(today.getMonth() + 1);
date.val(today.getDate());
// 検索ボタンが押された時の処理
const searchButton = $("#SearchButton");
searchButton.click(function () {
chrome.runtime.sendMessage({
type: "OpenPage",
date: year.val() + "." + month.val() + "." + date.val(),
}, function (type) {
window.close();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment