In this exercise you'll be working on an appointment scheduler for a beauty salon that opened on September 15th in 2012.
You have five tasks, which will all involve appointment dates.
Implement the Schedule function to parse a textual representation of an appointment date into the corresponding time.Time format:
Schedule("7/25/2019 13:45:00")
// => 2019-07-25 13:45:00 +0000 UTCImplement the HasPassed function that takes an appointment date and checks if the appointment was somewhere in the past:
HasPassed("July 25, 2019 13:45:00")
// => trueImplement the IsAfternoonAppointment function that takes an appointment date and checks if the appointment is in the afternoon (>= 12:00 and < 18:00):
IsAfternoonAppointment("Thursday, July 25, 2019 13:45:00")
// => trueImplement the Description function that takes an appointment date and returns a description of that date and time:
Description("7/25/2019 13:45:00")
// => "You have an appointment on Thursday, July 25, 2019, at 13:45."Implement the AnniversaryDate function that returns the anniversary date of the salon's opening for the current year in UTC.
Assuming the current year is 2020:
AnniversaryDate()
// => 2020-09-15 00:00:00 +0000 UTCNote: the return value is a time.Time and the time of day doesn't matter.
In this exercise you'll be working on an appointment scheduler for a beauty salon that opened on September 15th in 2012.
You have five tasks, which will all involve appointment dates.
Implement the Schedule function to parse a textual representation of an appointment date into the corresponding time.Time format:
Schedule("7/25/2019 13:45:00")
// => 2019-07-25 13:45:00 +0000 UTCImplement the HasPassed function that takes an appointment date and checks if the appointment was somewhere in the past:
HasPassed("July 25, 2019 13:45:00")
// => trueImplement the IsAfternoonAppointment function that takes an appointment date and checks if the appointment is in the afternoon (>= 12:00 and < 18:00):
IsAfternoonAppointment("Thursday, July 25, 2019 13:45:00")
// => trueImplement the Description function that takes an appointment date and returns a description of that date and time:
Description("7/25/2019 13:45:00")
// => "You have an appointment on Thursday, July 25, 2019, at 13:45."Implement the AnniversaryDate function that returns the anniversary date of the salon's opening for the current year in UTC.
Assuming the current year is 2020:
AnniversaryDate()
// => 2020-09-15 00:00:00 +0000 UTCNote: the return value is a time.Time and the time of day doesn't matter.