Skip to content

Category: Questions

Reading backend data, ISO format date

I get data from the backend that look like that start: ‘2022-10-22T00:00:00Z, end: ‘2022-10-26T00:00:00Z regarding the discount of a product. So that basically means that the product is discounted until 25.10.22 until 23.59, right? Thought it would be until 26.10.22 until 23.59 and got a bit confu…

PHP JavaScript – Escaping variables written like ${HOST}

How to escape variables from DB like ${HOST}? The situation happens when there is some code posted in tags <pre><code>. If it remains as it is there’s the error Uncaught ReferenceError: HOST is not defined. It’s needed in a context where it’s required to use the character ` for e…