Vor Kurzem aufgerufene Suchen
Keine vor kurzem aufgerufene Suchen

James McGahn
Beigetreten 16. Apr. 2021
·
Letzte Aktivität 27. Okt. 2021
Folge ich
0
Follower
0
Gesamtaktivitäten
4
Stimme
1
Abonnement
1
AKTIVITÄTSÜBERSICHT
BADGES
BEITRÄGE
POSTS
COMMUNITY-KOMMENTARE
BEITRAGSKOMMENTARE
AKTIVITÄTSÜBERSICHT
Neueste Aktivität von James McGahn
James McGahn hat einen Kommentar hinterlassen
@...
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 %}
Kommentar anzeigen · Gepostet 16. Juli 2020 · James McGahn
0
Follower
0
Stimmen
0
Kommentare
James McGahn hat einen Kommentar hinterlassen
@...
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' }}
Kommentar anzeigen · Gepostet 05. Juni 2020 · James McGahn
0
Follower
0
Stimmen
0
Kommentare