mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-16 10:03:54 -07:00
nuxt init
This commit is contained in:
parent
79b3985a49
commit
8d3db89327
275 changed files with 13274 additions and 4003 deletions
52
frontend.old/src/utils/index.js
Normal file
52
frontend.old/src/utils/index.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
import { recipe } from "@/utils/recipe";
|
||||
import { store } from "@/store";
|
||||
|
||||
// TODO: Migrate to Mixins
|
||||
|
||||
export const utils = {
|
||||
recipe: recipe,
|
||||
generateUniqueKey(item, index) {
|
||||
return `${item}-${index}`;
|
||||
},
|
||||
getDateAsPythonDate(dateObject) {
|
||||
if (!dateObject) return null;
|
||||
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",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue