{"ScriptPreparationCode":"var dateStr = \u00222021-08-10\u0022;\r\nvar dateDate = new Date(dateStr);\r\nvar formatter = new Intl.DateTimeFormat(\u0022pt-PT\u0022);","TestCases":[{"Name":"split","Code":"const [yyyy, mm, dd] = dateStr.split(\u0022/\u0022);\r\nconst result =\u0060${dd}/${mm}/${yyyy}\u0060;","IsDeferred":false},{"Name":"Date toLocaleString without date being cached","Code":"const result = new Date(dateStr).toLocaleString(\u0022pt-PT\u0022);","IsDeferred":false},{"Name":"slice","Code":"const day = dateStr.slice(8, 10);\r\nconst month = dateStr.slice(5, 7);\r\nconst year = dateStr.slice(0, 4);\r\nconst result = \u0060${day}/${month}/${year}\u0060","IsDeferred":false},{"Name":"substring","Code":"const day = dateStr.substring(8, 10);\r\nconst month = dateStr.substring(5, 7);\r\nconst year = dateStr.substring(0, 4);\r\nconst result = \u0060${day}/${month}/${year}\u0060","IsDeferred":false},{"Name":"Intl no format cache no date cache","Code":"const result = new Intl.DateTimeFormat(\u0022pt-PT\u0022).format(new Date(dateStr));","IsDeferred":false},{"Name":"Intl no format cache with date cache","Code":"const result = new Intl.DateTimeFormat(\u0022pt-PT\u0022).format(dateDate);","IsDeferred":false},{"Name":"Intl with format cache no date cache","Code":"const result = formatter.format(new Date(dateStr));","IsDeferred":false},{"Name":"Intl with format cache with date cache","Code":"const result = formatter.format(dateDate);","IsDeferred":false},{"Name":"Date toLocaleString with date being cached","Code":"const result = dateDate.toLocaleString(\u0022pt-PT\u0022);","IsDeferred":false}]}