mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-06-02 21:25:45 -04:00
* multiple recipes per day * fix update * meal-planner rewrite * disable meal-tests * spacing Co-authored-by: hay-kot <hay-kot@pm.me>
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
import { recipe } from "@/utils/recipe";
|
|
import { store } from "@/store";
|
|
|
|
// TODO: Migrate to Mixins
|
|
|
|
export const utils = {
|
|
recipe: recipe,
|
|
generateUniqueKey(item, index) {
|
|
const uniqueKey = `${item}-${index}`;
|
|
return uniqueKey;
|
|
},
|
|
getDateAsPythonDate(dateObject) {
|
|
const month = dateObject.getMonth() + 1;
|
|
const day = dateObject.getDate();
|
|
const year = dateObject.getFullYear();
|
|
return `${year}-${month}-${day}`;
|
|
},
|
|
notify: {
|
|
info: function(text, title = null) {
|
|
store.commit("setSnackbar", {
|
|
open: true,
|
|
title: title,
|
|
text: text,
|
|
color: "info",
|
|
});
|
|
},
|
|
success: function(text, title = null) {
|
|
store.commit("setSnackbar", {
|
|
open: true,
|
|
title: title,
|
|
text: text,
|
|
color: "success",
|
|
});
|
|
},
|
|
error: function(text, title = null) {
|
|
store.commit("setSnackbar", {
|
|
open: true,
|
|
title: title,
|
|
text: text,
|
|
color: "error",
|
|
});
|
|
},
|
|
warning: function(text, title = null) {
|
|
store.commit("setSnackbar", {
|
|
open: true,
|
|
title: title,
|
|
text: text,
|
|
color: "warning",
|
|
});
|
|
},
|
|
},
|
|
};
|