mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Show relative date in purchase form
This commit is contained in:
@@ -281,6 +281,8 @@ $(function()
|
||||
$('#flow-info-addbarcodetoselection').removeClass('hide');
|
||||
$('#barcode-lookup-disabled-hint').removeClass('hide');
|
||||
}
|
||||
|
||||
Grocy.EmptyElementWhenMatches('#best-before-timeago', 'NaN years ago');
|
||||
});
|
||||
|
||||
$('#best_before_date-datepicker-button').on('click', function(e)
|
||||
@@ -310,6 +312,9 @@ $('#best_before_date').on('change', function(e)
|
||||
$('#best_before_date').val(value);
|
||||
$('#purchase-form').validator('validate');
|
||||
}
|
||||
|
||||
$('#best-before-timeago').text($.timeago($('#best_before_date').val()));
|
||||
Grocy.EmptyElementWhenMatches('#best-before-timeago', 'NaN years ago');
|
||||
});
|
||||
|
||||
$('#best_before_date').on('keydown', function(e)
|
||||
|
Reference in New Issue
Block a user