Last active
October 13, 2017 14:01
-
-
Save katyayu/8f04e36da914559c6a32b094bd9ac7ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if settings.badge_toggle and settings.new_products_period.size > 0 %} | |
{% comment %}Is this product new?{% endcomment %} | |
{% assign date_pub_y = product.published_at | date:'%Y' %} | |
{% assign date_pub_d = product.published_at | date:'%j' %} | |
{% assign date_now_y = 'now' | date:'%Y' %} | |
{% assign date_now_d = 'now' | date:'%j' %} | |
{% assign dates_diff_y = date_now_y | minus: date_pub_y | times: 365 %} | |
{% assign dates_diff_d = date_now_d | minus: date_pub_d %} | |
{% assign dates_diff = dates_diff_y | plus: dates_diff_d %} | |
{% assign new_products_period = settings.new_products_period | plus: 0 %} | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment