mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-05 04:52:58 +00:00
b
This commit is contained in:
+2
-21
@@ -172,7 +172,7 @@
|
|||||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||||
<i class="fas fa-clock text-gray-400"></i>
|
<i class="fas fa-clock text-gray-400"></i>
|
||||||
</div>
|
</div>
|
||||||
<input type="time" id="time_start" name="time_start" required step="3600
|
<input type="time" id="time_start" name="time_start" required
|
||||||
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-brand-light-blue focus:border-brand-light-blue">
|
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-brand-light-blue focus:border-brand-light-blue">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||||
<i class="fas fa-clock text-gray-400"></i>
|
<i class="fas fa-clock text-gray-400"></i>
|
||||||
</div>
|
</div>
|
||||||
<input type="time" id="time_end" name="time_end" required step="3600"
|
<input type="time" id="time_end" name="time_end" required
|
||||||
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-brand-light-blue focus:border-brand-light-blue">
|
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-brand-light-blue focus:border-brand-light-blue">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -593,24 +593,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Add this JavaScript to enforce full hours -->
|
|
||||||
<script>
|
|
||||||
// Function to round time to nearest hour
|
|
||||||
function roundToHour(input) {
|
|
||||||
const time = input.value;
|
|
||||||
if (time) {
|
|
||||||
const [hours, minutes] = time.split(':');
|
|
||||||
input.value = `${hours}:00`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add event listeners to time inputs
|
|
||||||
const timeInputs = document.querySelectorAll('input[type="time"]');
|
|
||||||
timeInputs.forEach(input => {
|
|
||||||
input.addEventListener('change', () => roundToHour(input));
|
|
||||||
input.addEventListener('blur', () => roundToHour(input));
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user