0
私は、「Shopify Liquid Template」の特定の要素が現在の日付がMetafieldで指定された日付よりも多かったり、小さい場合にのみ表示される整備士のように作成しようとしています。現在のよう日付比較ロジック/液体テンプレートフィルター
これは、私は、ロジックを含めたものである:私は2018年1月1日に先行順日付を設定しても、それはまだ「よりも大きい」を示し、しかし
<!-- Check Today is correct -->
<p>Today: {{'now' | date: '%d-%m-%Y' }}</p>
<!-- This is the Metafield Output as a String -->
<p>Release Date: {{ product.metafields.Release-Date.preOrder }}</p>
<!-- Assign Variable "today_date" to the current date -->
{% assign today_date = 'now' | date: '%d-%m-%Y' %}
<!-- Assign Variable "pre_date" to the string of the metafield -->
{% assign pre_date = product.metafields.Release-Date.preOrder %}
{% if today_date > pre_date %}
Today's date is greater than PreOrder Date
{% else %}
Today's date is not greater than PreOrder Date
{% endif %}
を。
これを正しくクエリするにはどうすればよいですか?
これは完璧であり、多くの意味を持ちます。本当に説明に感謝します.-) –