Added full day of the week names to input

This commit is contained in:
xavi 2024-10-07 14:13:35 -07:00
parent c094fad433
commit c5fcad6ff3

View File

@ -81,35 +81,35 @@ int get_due_date(filtered_tasks *task, char* passed_date){
if ( x_strcmp(passed_date, "today") == 0 ){
get_today(d);
}
else if ( x_strcmp(passed_date, "tomorrow") == 0 ) {
else if ( x_strcmp(passed_date, "tom") == 0 || x_strcmp(passed_date, "tomorrow") == 0 ) {
get_today(d);
get_day_of_week(d, d->dow + 1);
}
else if ( x_strcmp(passed_date, "sun") == 0 ){
else if ( x_strcmp(passed_date, "sun") == 0 || x_strcmp(passed_date, "sunday") == 0 ){
day_of_week = 0;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "mon") == 0 ){
else if ( x_strcmp(passed_date, "mon") == 0 || x_strcmp(passed_date, "monday") == 0 ){
day_of_week = 1;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "tues") == 0 ){
else if ( x_strcmp(passed_date, "tues") == 0 || x_strcmp(passed_date, "tuesday") == 0 ){
day_of_week = 2;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "wed") == 0 ){
else if ( x_strcmp(passed_date, "wed") == 0 || x_strcmp(passed_date, "wednesday") == 0 ){
day_of_week = 3;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "thurs") == 0 ){
else if ( x_strcmp(passed_date, "thurs") == 0 || x_strcmp(passed_date, "thursday") == 0 ){
day_of_week = 4;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "fri") == 0 ){
else if ( x_strcmp(passed_date, "fri") == 0 || x_strcmp(passed_date, "friday") == 0 ){
day_of_week = 5;
get_day_of_week(d, day_of_week);
}
else if ( x_strcmp(passed_date, "sat") == 0 ){
else if ( x_strcmp(passed_date, "sat") == 0 || x_strcmp(passed_date, "saturday") == 0 ){
day_of_week = 6;
get_day_of_week(d, day_of_week);
}