// Utility functions for Tera templates - INITIAL VERSION // Format a date string fn format_date(date_str) { let parts = date_str.split("-"); let year = parts[0]; let month = parts[1]; let day = parts[2]; return `${month}/${day}/${year}`; } // Calculate a price with discount fn calculate_price(price, discount_percent) { let discount = price * (discount_percent / 100.0); return price - discount; } // Format a currency value fn format_currency(amount) { return "$" + amount; }