某所より要望があったので作りました。 ソースと使い方 ソースです。jQueryは別途用意してください。 $(document).ready(function() { $(".view_timer").each(function(index, target) { var startDate = $(this).attr("data-start-date"); var endDate = $(this).attr("data-end-date"); var nowDate = new Date(); if (startDate) { startDate = new Date(startDate); } else { startDate = nowDate; } if (endDate) { endDate = new Date(endDate); } if (startDate <= nowD
![ブラウザ側で日時指定で表示・非表示を切り替えるスクリプト - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/15f43e4de7c5cd1d964a543c0122ffcfb3e39006/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-412672c5f0600ab9a64263b751f1bc81.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTk3MiZoPTM3OCZ0eHQ9JUUzJTgzJTk2JUUzJTgzJUE5JUUzJTgyJUE2JUUzJTgyJUI2JUU1JTgxJUI0JUUzJTgxJUE3JUU2JTk3JUE1JUU2JTk5JTgyJUU2JThDJTg3JUU1JUFFJTlBJUUzJTgxJUE3JUU4JUExJUE4JUU3JUE0JUJBJUUzJTgzJUJCJUU5JTlEJTlFJUU4JUExJUE4JUU3JUE0JUJBJUUzJTgyJTkyJUU1JTg4JTg3JUUzJTgyJThBJUU2JTlCJUJGJUUzJTgxJTg4JUUzJTgyJThCJUUzJTgyJUI5JUUzJTgyJUFGJUUzJTgzJUFBJUUzJTgzJTk3JUUzJTgzJTg4JnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnR4dC1jb2xvcj0lMjMxRTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmcz02MDg5NjYzYjhjMmY0NGNhM2JiMGNlYjk3NDQzNjA0Mg%26mark-x%3D142%26mark-y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