From 8e9ed09ce3b00426712f4a6e7c9f804d40dc4a7f Mon Sep 17 00:00:00 2001 From: Steve Bosman Date: Tue, 1 Feb 2022 00:10:47 +0000 Subject: [PATCH] 95 Weekday - introduce classes for durations and dates --- 95_Weekday/javascript/weekday.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/95_Weekday/javascript/weekday.js b/95_Weekday/javascript/weekday.js index 6feeda2e..ec2386d0 100644 --- a/95_Weekday/javascript/weekday.js +++ b/95_Weekday/javascript/weekday.js @@ -78,14 +78,14 @@ const COMMON_YEAR_MONTH_OFFSET = [0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5]; * Reads a date, and extracts the date information. * This expects date parts to be comma separated, using US date ordering, * i.e. Month,Day,Year. - * @returns {Promise<{year: number, month: number, day: number}>} + * @returns {Promise} */ async function readDateElements() { let dateString = await input(); const month = parseInt(dateString); const day = parseInt(dateString.substr(dateString.indexOf(",") + 1)); const year = parseInt(dateString.substr(dateString.lastIndexOf(",") + 1)); - return {year, month, day}; + return new DateStruct(year, month, day); } /**