Is this Snippet possible in TB?

Hi Guys
I have a complex Snippet i use in PE and i need to know if this is possible in TB.
It looks like this see code below

(* 20191009 • Order tracking Version 1 with #calendar/#input - without forms
){#settemp -name ##ordered_on -content {#calendar -f ddddd -head Order placed on… -manual -locale en-GB}}(
){#settemp -name ##day_offset -content {#input -head Ordered on {#gettemp ##ordered_on} • How many delivery time in days? -def +5 -single -required}}(
delivery deadline ##du_day
){#settemp -name ##du_day -content {#datetime -f ddddd -value {#gettemp ##ordered_on} -s {#gettemp ##day_offset}w -locale en-GB}}(
Delivery time expired?
*){#check -text {#datetime -a -value {#gettemp ##du_day} -locale en-GB} -case < {#datetime -a -locale en-GB} -output Hello Guys
Please, could you get one of your Logistics Team members to chase up the shipping status for this order?
The order was placed on {#datetime -f dddd, ddddd -value {#gettemp ##ordered_on} -locale en-GB}.

The ABC website shows the shipping for this item is {#gettemp ##day_offset} business days.

This should have been delivered on {#datetime -f dddd, ddddd -value {#gettemp ##du_day} -locale en-GB}

The item is now {#datecalc -date2 {#gettemp ##du_day} -mode 3} business days late!
The item is now {#calc {#datetime -a -value {#gettemp ##du_day} -locale en-GB}-{#datetime -a -locale en-GB} -round 0} calendar days late!

I need this to update my customer and avoid cancellation of the order.(*
Delivery time not yet expired → Windows Notification
*) -else {#balloon -title Delivery time not yet expired: -text ##du_day: {#gettemp ##du_day} -onclick {#datetime -f ddd, ddddd -value {#gettemp ##du_day} -locale en-GB}}}

Hi @anon30495567

Absolutely! Something like this should work:

{note}
{formdate: YYYY-MM-DD; default={time: YYYY-MM-DD}; name=placed}

{endnote: trim=right}
Hello Guys,

Please, could you get one of your Logistics Team members to chase up the shipping status for this order?

The order was placed on {time: dddd, MMMM Do; at={=placed}}{if: {time: YYYY; at={=placed}} == {time: YYYY}-1} last year{endif}.

The {formtext: name=carrier; default=carrier's} website shows the shipping is {formtext: name=shipping; cols=5; default=5} {formmenu: name=days; default=business; calendar} days.

This should have been delivered on {if: days=="business"; trim=right}
{time: dddd, MMMM Do; at={=placed}; shift={=shipping}D(skip=SAT, SUN)}.

The item is now {=round((({time: X} - {time: X; at={time: YYYY-MM-DD; at={=placed}; shift={=shipping}D(skip=SAT, SUN)}}) / 24 / 60 / 60 / 7)*5)} {=days} days late.
{else: trim=right}
{time: dddd, MMMM Do; at={=placed}; shift={=shipping}D}.

The item is now {=round(({time: X} - {time: X; at={time: YYYY-MM-DD; at={=placed}; shift={=shipping}D(skip=SAT, SUN)}}) / 24 / 60 / 60)} {=days} days late.
{endif}

I've added a few fancy touches to it, namely:

  1. If the order happened last year, it will automatically add "last year" at the end of the sentence
  2. You've got a dropdown to choose between business days or calendar days
  3. Based on whether you've chosen business days or calendar days, the calculation for the difference in days will change i.e. business days will skip saturdays and sundays

It can probably be improved, but it should do the trick for now. :slight_smile:

Let me know if you have any questions!

P.S. You can copy it directly to your dashboard by clicking the "Copy to Text Blaze" button :wink: