From 9bf9faec1ebae6efaad3a1a589e92fae53ee6ff7 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 29 Aug 2021 21:17:43 +0200 Subject: [PATCH] Also add shortcut for date input --- assets/js/sections/qso.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 0ae7aadb..a188f8c6 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -459,7 +459,7 @@ if ($('#frequency').val() == "") }); } -/* format time input shortcut */ +/* time input shortcut */ $('#start_time').change(function() { var raw_time = $(this).val(); if(raw_time.match(/^\d\[0-6]d$/)) { @@ -471,6 +471,15 @@ $('#start_time').change(function() { } }); +/* date input shortcut */ +$('#start_date').change(function() { + raw_date = $(this).val(); + if(raw_date.match(/^[12]\d\d\d[01]\d[0123]\d$/)) { + raw_date = raw_date.substring(0,4)+"-"+raw_date.substring(4,6)+"-"+raw_date.substring(6,8); + $('#start_date').val(raw_date); + } +}); + /* on mode change */ $('.mode').change(function() { $.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) {