标签搜索

Shopify delivery date

sunshine
2023-07-11 / 0 评论 / 164 阅读
温馨提示:
本文最后更新于2023年07月11日,已超过633天没有更新,若内容或图片失效,请留言反馈。

Shopify delivery date

<div class="sun-delivery"></div>
<script>
    $(function () {
        const minDays = parseInt({{ block.settings.min_date | default: 0}});
        const maxDays = parseInt({{ block.settings.max_date | default: 0 }});
        const customText = '{{block.settings.custom_content}}';
        const minDate = new Date(Date.now() + (minDays * 86400000));
        const maxDate = new Date(Date.now() + (maxDays * 86400000));
        const formatDate = (minDate.getFullYear() == maxDate.getFullYear() && minDate.getFullYear() == new Date().getFullYear())
            ? new Intl.DateTimeFormat('en', {month: 'short', day: '2-digit'})
            : new Intl.DateTimeFormat('en', {month: 'short', day: '2-digit', year: 'numeric'});
        const tipText = customText.replace(/\{min_date\}/g, '<b>' + formatDate.format(minDate) + '</b>')
            .replace(/\{max_date\}/g, '<b>' + formatDate.format(maxDate) + '</b>');
      $('.sun-delivery').html(tipText)
        
    })

</script>
感觉很棒,欢迎点赞 OR 打赏~
0
分享到:

评论 (0)

OωO
  • ::(呵呵)
  • ::(哈哈)
  • ::(吐舌)
  • ::(太开心)
  • ::(笑眼)
  • ::(花心)
  • ::(小乖)
  • ::(乖)
  • ::(捂嘴笑)
  • ::(滑稽)
  • ::(你懂的)
  • ::(不高兴)
  • ::(怒)
  • ::(汗)
  • ::(黑线)
  • ::(泪)
  • ::(真棒)
  • ::(喷)
  • ::(惊哭)
  • ::(阴险)
  • ::(鄙视)
  • ::(酷)
  • ::(啊)
  • ::(狂汗)
  • ::(what)
  • ::(疑问)
  • ::(酸爽)
  • ::(呀咩爹)
  • ::(委屈)
  • ::(惊讶)
  • ::(睡觉)
  • ::(笑尿)
  • ::(挖鼻)
  • ::(吐)
  • ::(犀利)
  • ::(小红脸)
  • ::(懒得理)
  • ::(勉强)
  • ::(爱心)
  • ::(心碎)
  • ::(玫瑰)
  • ::(礼物)
  • ::(彩虹)
  • ::(太阳)
  • ::(星星月亮)
  • ::(钱币)
  • ::(茶杯)
  • ::(蛋糕)
  • ::(大拇指)
  • ::(胜利)
  • ::(haha)
  • ::(OK)
  • ::(沙发)
  • ::(手纸)
  • ::(香蕉)
  • ::(便便)
  • ::(药丸)
  • ::(红领巾)
  • ::(蜡烛)
  • ::(音乐)
  • ::(灯泡)
  • ::(开心)
  • ::(钱)
  • ::(咦)
  • ::(呼)
  • ::(冷)
  • ::(生气)
  • ::(弱)
  • ::(狗头)
泡泡
阿鲁
颜文字
取消

请先登录后再进行评论或留言