mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
update to make menu items pull for first 9 days of month.
This commit is contained in:
parent
2ce2499347
commit
3b9a54daf1
3 changed files with 4 additions and 15 deletions
|
|
@ -21,12 +21,7 @@
|
||||||
<span class="card-title"><h4>{{todayDate}}</h4></span>
|
<span class="card-title"><h4>{{todayDate}}</h4></span>
|
||||||
{{#each todayMenuItem}}
|
{{#each todayMenuItem}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s6"><h3><i class="medium material-icons">local_dining</i>{{itemName}}</h3></div>
|
<div class="col s12"><h4><i class="medium material-icons">local_dining</i> {{itemName}}</h4></div>
|
||||||
<div class="col s6">
|
|
||||||
{{#each nextDays}}
|
|
||||||
<p class="flow-text">Tomorrow - {{itemName}}</p>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -47,15 +47,9 @@ Template.dashboard.helpers({
|
||||||
},
|
},
|
||||||
todayDate: function() {
|
todayDate: function() {
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let todayDate = moment(now).format("MMM D, YYYY");
|
let todayDate = moment(now).format("MMM DD, YYYY");
|
||||||
return todayDate;
|
return todayDate;
|
||||||
},
|
},
|
||||||
nextDays: function() {
|
|
||||||
let now = new Date();
|
|
||||||
let nowDate = moment(now).add(1, 'day').format("MM D, YYYY");
|
|
||||||
console.log("nowDate = " + nowDate);
|
|
||||||
return MenuItems.find({ serveDate: nowDate });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.dashboard.events({
|
Template.dashboard.events({
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ Meteor.publish("myMenuItems", function(menuId) {
|
||||||
Meteor.publish("todayMenuItems", function() {
|
Meteor.publish("todayMenuItems", function() {
|
||||||
try {
|
try {
|
||||||
let todayDate = new Date();
|
let todayDate = new Date();
|
||||||
let todaysDate = moment(todayDate).format("MMM D, YYYY");
|
let todaysDate = moment(todayDate).format("MMM DD, YYYY");
|
||||||
return MenuItems.find({ serveDate: todaysDate });
|
return MenuItems.find({ serveDate: todaysDate, itemMade: false });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(" ERROR pulling today's menu items: " + error);
|
console.log(" ERROR pulling today's menu items: " + error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue