check-appointment-status
v1.0.11
Published
Check appointment status and return color Red for Past appointments, Green for Today appointments and White for Future appointments.
Downloads
20
Readme
Check Appointment Status
Pass Date Object to the function
Function returns Colour name.
Red - Past Appointments
Green - Today Appointmets
White - Future Appointments
Example of Date Object:
Date Object Format: 'YYYY-MM-DD'
Date Object Format: 'YYYY-MM-DD HH:MM:SS'
Example:
const checkStatus = require('check-appointment-status');
let appointment = new Date('2023-03-27');
let colour = checkStatus(appointment);
// or
let appointment = new Date('2023-03-27 00:00:00');
let colour = checkStatus(appointment);
Response
Green