最近の検索
最近の検索はありません

James McGahn
参加日2021年4月16日
·
前回のアクティビティ2021年10月27日
フォロー中
0
フォロワー
0
合計アクティビティ
4
投票
1
サブスクリプション
1
アクティビティの概要
バッジ
記事
投稿
コミュニティへのコメント
記事へのコメント
アクティビティの概要
さんの最近のアクティビティ James McGahn
James McGahnさんがコメントを作成しました:
@...
You want it to count three days in the future but not the weekends? If so, try out the below
Assigns today -> the day of the week
If wed -> then add 5 days in seconds to now == mon
if thurs -> then add 4 days in seconds to now == mon
else -> add 3 days in seconds to now
{% assign today = 'now' | date: '%A' %}
{% if today == 'Wednesday' %}
{{ 'now' | date: '%s' | plus:432000 | date: '%Y-%m-%d' }}
{% elsif today == 'Thursday' %}
{{ 'now' | date: '%s' | plus:345600 | date: '%Y-%m-%d' }}
{% else %}
{{ 'now' | date: '%s' | plus:259200 | date: '%Y-%m-%d' }}
{% endif %}
コメントを表示 · 投稿日時:2020年7月16日 · James McGahn
0
フォロワー
0
投票
0
コメント
James McGahnさんがコメントを作成しました:
@...
there may be a simpler way to do it but this should work
finds day of week, minuses day of the week from 7. takes that calculates the seconds and then adds that to the current date.
test it out
{% assign today = 'now' | date: '%u' %}{% assign dayWeek = 7 | minus: today %}
{% assign seconds = dayWeek | times: 24 | times: 60 | times: 60 %}
{{ 'now' | date: '%s' | plus: seconds | date: '%Y-%m-%d' }}
コメントを表示 · 投稿日時:2020年6月05日 · James McGahn
0
フォロワー
0
投票
0
コメント