Skip to content

Instantly share code, notes, and snippets.

@dancinllama
Created November 3, 2015 18:12
Show Gist options
  • Save dancinllama/ac8809adcd03efa2d0ab to your computer and use it in GitHub Desktop.
Save dancinllama/ac8809adcd03efa2d0ab to your computer and use it in GitHub Desktop.

Revisions

  1. James Loghry created this gist Nov 3, 2015.
    24 changes: 24 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    IF(
    OR(
    ISBLANK(Available_From__c)
    ,Available_From__c < CASE(
    MOD(TODAY() - DATE( 1900, 1, 7 ), 7 ),
    2, TODAY() + 2 + 4,
    3, TODAY() + 2 + 4,
    4, TODAY() + 2 + 4,
    5, TODAY() + 2 + 4,
    6, TODAY() + 1 + 4,
    TODAY() + 4
    )
    ),
    CASE(
    MOD(TODAY() - DATE( 1900, 1, 7 ), 7 ),
    2, TODAY() + 2 + 4,
    3, TODAY() + 2 + 4,
    4, TODAY() + 2 + 4,
    5, TODAY() + 2 + 4,
    6, TODAY() + 1 + 4,
    TODAY() + 4
    ),
    Available_From__c
    )