nord vpnnord vpn
Ad

Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
1.6 kB
2
Indexable
Never
assign today_cutoff_datetime = today_cutoff_string | date: '%s'
assign now_datetime = 'now' | date: '%s'

# Monday - Friday before 2pm
if day_number < 6 and now_datetime < today_cutoff_datetime
  assign message = 'Want it delivered tomorrow?'

  # Cut off - Today 14:00
  assign expiry = today_cutoff_datetime
endif

# Monday - Thursday after 2pm
if day_number < 5 and now_datetime > today_cutoff_datetime
  assign days = 2 | times: 86400
  assign now_plus_2_days = now_datetime | plus: days | date: '%A'

  assign message = 'Want it delivered ' | append: now_plus_2_days | append: '?'

  # Cut off - Following day 14:00
  assign expiry = today_cutoff_datetime | plus: 86400
endif

# Friday after 2pm
if day_number == 5 and now_datetime > today_cutoff_datetime
  assign message = 'Want it dispatched Monday?'

  # Cut off - Saturday 14:00
  assign expiry = today_cutoff_datetime | plus: 86400
endif

# Saturday before 2pm
if day_number == 6 and now_datetime < today_cutoff_datetime
  assign days = 2 | times: 86400

  assign message = 'Want it dispatched Monday?'

  # Cut off - Monday 14:00
  assign expiry = today_cutoff_datetime | plus: days
endif

# Saturday after 2pm
if day_number == 6 and now_datetime > today_cutoff_datetime
  assign days = 2 | times: 86400

  assign message = 'Want it dispatched Monday?'

  # Cut off - Monday 14:00
  assign expiry = today_cutoff_datetime | plus: days
endif

# Sunday
if day_number == 7
  assign message = 'Want it dispatched tomorrow?'

  # Cut off - Monday 14:00
  assign expiry = today_cutoff_datetime | plus: 86400
endif

nord vpnnord vpn
Ad