In this exercise you'll be working on an appointment scheduler for a beauty salon.
You have three tasks, which will all involve appointment dates.
Implement the appointment_has_passed subroutine that takes a date string and checks if the appointment was somewhere in the past:
appointment_has_passed("2019-07-25T13:45:00")
// => trueDate strings will be passed in ISO 8601 datetime format: YYYY-mm-ddTHH:MM:SS
You will need to implement the private _parse_datetime subroutine.
A couple of modules are suggested for you:
Implement the is_afternoon_appointment function that takes a date string and checks if the appointment is in the afternoon (>= 12:00 and < 18:00):
is_afternoon_appointment("2019-07-25T13:45:00")
// => trueImplement the describe_appointment function that takes a date string and returns a description of that date and time:
describe_appointment("2019-07-25T13:45:00")
// => "You have an appointment on 07/25/2019 1:45 PM"Note the hour is in the range 0-12 and does not have a leading zero or space.
In this exercise you'll be working on an appointment scheduler for a beauty salon.
You have three tasks, which will all involve appointment dates.
Implement the appointment_has_passed subroutine that takes a date string and checks if the appointment was somewhere in the past:
appointment_has_passed("2019-07-25T13:45:00")
// => trueDate strings will be passed in ISO 8601 datetime format: YYYY-mm-ddTHH:MM:SS
You will need to implement the private _parse_datetime subroutine.
A couple of modules are suggested for you:
Implement the is_afternoon_appointment function that takes a date string and checks if the appointment is in the afternoon (>= 12:00 and < 18:00):
is_afternoon_appointment("2019-07-25T13:45:00")
// => trueImplement the describe_appointment function that takes a date string and returns a description of that date and time:
describe_appointment("2019-07-25T13:45:00")
// => "You have an appointment on 07/25/2019 1:45 PM"Note the hour is in the range 0-12 and does not have a leading zero or space.