Use Jquery to obtain present date/time

Uniquino_Shop
New Member
1 0 0

Good day, to all! 

I hope this is the right category to post my question...

As Shopify servers use cashed date/time, It becomes useless to use 'now' | date: in liquid.

I am not a developer, just a beginner who need few tweaks to my them. My question what script should I add to my product template in order to be equivalent to the following liquid script:

{% if instructions.hot_sold != blank %}
  {% capture day %}{{ 'now' | date: '%A' }}{% endcapture %}
  {% case day %}
   {% when 'Monday' %}
    <div id="people-viewing" style="color:#333333">
      <p><span style="background:#4dbc15">&nbsp;</span><b><span style="background:#4dbc15; 
      color:#ffffff">{{ instructions.hot_sold | slice: 0 }} </span></b><span>&nbsp;pieces sold in 
      the last 24 hours!</span></p>
    </div>
    {% endcase %}
{% endif %}

it is just an example, and once I figured out how to, I will adjust all my snippets.

Thank you in advance!

Best regards

0 Likes