HanasakiSushiBar Posted June 17 Posted June 17 Hi everyone! On my website we have a daily menu that we make daily changes too and currently we are manually changing the date everyday. I added a text block at the top of the page to manually do this. Does anyone know of a way or code to have this change daily to be today’s date? I have looked into 3rd party widgets but can’t seem to find anything that isn’t a calendar. please help! Thank you
tuanphan Posted June 19 Posted June 19 Can you share link to page where you use menu? We can imagine your layout easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
HanasakiSushiBar Posted June 20 Author Posted June 20 Yes! https://www.hanasakisushi.com/specials-menu
Solution DavidCliff Posted June 20 Solution Posted June 20 Try this code in a HTML block <div id="dateContainer"> <!-- Date will be displayed here --> </div> <script> const dateContainer = document.getElementById('dateContainer'); const currentDate = new Date(); const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; const formattedDate = currentDate.toLocaleDateString(undefined, options); dateContainer.textContent = formattedDate; </script> tuanphan 1
HanasakiSushiBar Posted July 10 Author Posted July 10 David, thank you so much! Can you help me learn how to fix the font style and size so that it can match the rest of the website?
tuanphan Posted July 13 Posted July 13 On 7/11/2024 at 4:06 AM, HanasakiSushiBar said: David, thank you so much! Can you help me learn how to fix the font style and size so that it can match the rest of the website? I think you can add this code under to adjust size <style> #dateContainer, #dateContainer * { font-size: 18px !important; } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment