Skip to content

Instantly share code, notes, and snippets.

@austriker27
Created February 10, 2023 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save austriker27/1a2785f87621153792265c1ca537f99a to your computer and use it in GitHub Desktop.
Save austriker27/1a2785f87621153792265c1ca537f99a to your computer and use it in GitHub Desktop.
Shipping delivery timeframe liquid snippet
<p style="color: #1d889b;">
<svg style="height:25px;float:left;margin-right:10px;padding-bottom: 2px;" class="h-6 w-6"
xmlns="http://www.w3.org/2000/svg" fill="#1d889b" viewBox="0 0 256 256">
<path fill="none" d="M0 0h256v256H0z" />
<path
d="M176 144H16v40a8 8 0 0 0 8 8h20a24 24 0 0 1 48 0h72a24 24 0 0 1 12-20.8ZM212 192a24 24 0 0 0-36-20.8V120h64v64a8 8 0 0 1-8 8h-20"
opacity=".2" />
<path d="M176 80h42.6a7.9 7.9 0 0 1 7.4 5l14 35M16 144h160" fill="none" stroke="#1d889b"
stroke-linecap="round" stroke-linejoin="round" stroke-width="16" />
<circle cx="188" cy="192" r="24" fill="none" stroke="#1d889b" stroke-miterlimit="10"
stroke-width="16" />
<circle cx="68" cy="192" r="24" fill="none" stroke="#1d889b" stroke-miterlimit="10"
stroke-width="16" />
<path fill="none" stroke="#1d889b" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"
d="M164 192H92M44 192H24a8 8 0 0 1-8-8V72a8 8 0 0 1 8-8h152v107.2M176 120h64v64a8 8 0 0 1-8 8h-20" />
</svg>
Carbon neutral shipping - Get it 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment