mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Finished first version of meal planning (for now closes #146)
This commit is contained in:
@@ -16,6 +16,11 @@ String.prototype.isEmpty = function()
|
||||
return (this.length === 0 || !this.trim());
|
||||
};
|
||||
|
||||
String.prototype.replaceAll = function(search, replacement)
|
||||
{
|
||||
return this.replace(new RegExp(search, "g"), replacement);
|
||||
};
|
||||
|
||||
GetUriParam = function(key)
|
||||
{
|
||||
var currentUri = decodeURIComponent(window.location.search.substring(1));
|
||||
@@ -72,3 +77,16 @@ $.extend($.expr[":"],
|
||||
return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
||||
}
|
||||
});
|
||||
|
||||
FindObjectInArrayByPropertyValue = function(array, propertyName, propertyValue)
|
||||
{
|
||||
for (var i = 0; i < array.length; i++)
|
||||
{
|
||||
if (array[i][propertyName] == propertyValue)
|
||||
{
|
||||
return array[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@@ -482,15 +482,19 @@ $("#about-dialog-link").on("click", function()
|
||||
});
|
||||
});
|
||||
|
||||
$(".locale-number-format[data-format='currency']").each(function ()
|
||||
function RefreshLocaleNumberDisplay()
|
||||
{
|
||||
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency }));
|
||||
});
|
||||
$(".locale-number-format[data-format='currency']").each(function()
|
||||
{
|
||||
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency }));
|
||||
});
|
||||
|
||||
$(".locale-number-format[data-format='quantity-amount']").each(function ()
|
||||
{
|
||||
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 }));
|
||||
});
|
||||
$(".locale-number-format[data-format='quantity-amount']").each(function()
|
||||
{
|
||||
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 3 }));
|
||||
});
|
||||
}
|
||||
RefreshLocaleNumberDisplay();
|
||||
|
||||
$(document).on("click", ".easy-link-copy-textbox", function()
|
||||
{
|
||||
|
Reference in New Issue
Block a user