Custom Liquid for expected delivery date no longer working.

OliviaMichaelCo
Pathfinder
97 7 18

Hey guys.

 

I upgraded from Dawn 2.3.0 to 3.0 recently and I've noticed that a piece of custom liquid I used to have working is no longer working. I don't know if it's related, however.

<p> We aim to dispatch all orders by the end of the next working day. Our courier should deliver to you between <strong><span id="fromDate"></span> - <span id="toDate"></span></strong></p>
{{ '//cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js' | script_tag }}
<script>
var fromDate = Date.today().addDays(5);
if (fromDate.is().saturday() || fromDate.is().sunday()) {
fromDate = fromDate.next().monday();
}
var toDate = Date.today().addDays(10);
if (toDate.is().saturday() || toDate.is().sunday()) {
toDate = toDate.next().monday();
}
document.getElementById('fromDate').innerHTML = fromDate.toString('dddd MMMM dS');
document.getElementById('toDate').innerHTML = toDate.toString('dddd MMMM dS');
</script>

It used to show "We aim to dispatch all orders by the end of the next working day. Our courier should deliver to you between <date 1> and <date 2>."

 

As you can see below, the dates no longer show. Is there anything immediately obvious that I'm missing now?

 

Screenshot 2022-03-02 at 15.01.26.jpg

Replies 3 (3)
LitExtension
Shopify Partner
3338 657 718

Hi @OliviaMichaelCo,

I tested and it works fine:

Screenshot.png

did you change it?

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
OliviaMichaelCo
Pathfinder
97 7 18

Hey @LitExtension it seems to be working now. I didn't change anything, it just started working. Weird.

 

Thanks for the reply.

Raeann
Tourist
4 0 1

Hi, thank you for the code @OliviaMichaelCo 

 

Can you explan me why my date is displayed in english ? I want the french version 😉 

 

WhatsApp Image 2022-04-25 at 16.25.11.jpeg

 

Thanks in advance for your help.
@LitExtension