Adding days to a date excluding weekends in Shopify
问题 I'm trying to write some code to estimate a shipping date in Shopify. I've been learning liquid but am having trouble writing some logic in Ruby. I'm not sure if Shopify templates use Ruby or Ruby on Rails. I want to get todays date and add either 3 or 5 days based on a input variable, excusing weekends. Heres how I'd do it in PHP: $orderDate = date('Y-m-d'); $personalized = true; $orderDays = ($personalized ? 4 : 2); (date('H') > 12 ? $orderDays++ : $false); $d = new DateTime( $orderDate );