3 ms·
Depends on the usecase. Sites for local stores need opening hours. Having those information as plain html is enough but that can be extended via ajax to show if
by waibelp 9y ago
Depends on the usecase. Sites for local stores need opening hours. Having those information as plain html is enough but that can be extended via ajax to show if store is currently open... So no need for dynamically rendered pages serverside.
- OtterCoder 9y agoNo need for ajax/fetch. You can calculate that in the browser with the data in your plain, static HTML.
- waibelp 9y agoSure, but can we trust the date and time of the client?
- thenomad 9y ago99% of the time, yes, I'd say. Having time/date wrong on your device - particularly a phone, which a lot of people use instead of a watch - is sufficiently annoying that it usually gets fixed.
- waibelp 9y agoGood point! I'll have a look into this, thanks! Edit: Great advice! Works like a charm! I've never really worked with dates in JS. Should have read the docs earlier ;-)