Started plan_meal function

master
Davide Bongiovanni 6 years ago
parent f20243b247
commit 680be19b07

@ -30,7 +30,23 @@ $( function() {
}); });
function plan_meal() { function plan_meal() {
var meal_date = $('#datepicker').datepicker('getDate');
if(isNaN($('#spinner-hour').val()) || isNaN($('#spinner-minute').val())) {
alert('Invalid time entered.');
return;
}
if(isNaN($('#deadline').val())) {
alert('Invalid deadline entered.');
return;
}
if ((0 <= +$('#spinner-hour').val() <= 23) && (0 <= +$('#spinner-minute').val() <= 59)) {
meal_date.setHours(+$('#spinner-hour').val(), +$('#spinner-minute').val())
} else {
alert('Invalid time entered.');
return;
}
var description_v = $('#flavor-text').val();
var deadline_amount = $('#deadline').val();
} }
function add_user() { function add_user() {

Loading…
Cancel
Save