-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed for holidays, only had 1 holiday for May ✨
- Loading branch information
Showing
3 changed files
with
15 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: hanmpark <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/11/22 13:56:48 by hanmpark #+# #+# */ | ||
/* Updated: 2023/03/14 01:16:49 by hanmpark ### ########.fr */ | ||
/* Updated: 2023/04/03 14:39:43 by hanmpark ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -18,6 +18,8 @@ | |
# define HOLIDAYS 1 | ||
# define DATES 0 | ||
|
||
# define INFO_BONUS 1 | ||
|
||
typedef struct s_data | ||
{ | ||
char **chosen; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: hanmpark <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/12/16 17:20:10 by hanmpark #+# #+# */ | ||
/* Updated: 2023/03/14 01:24:47 by hanmpark ### ########.fr */ | ||
/* Updated: 2023/04/03 14:43:10 by hanmpark ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -116,10 +116,10 @@ static void print_progressbar(int tthours, int hours) | |
|
||
static void print_info(t_data *data) | ||
{ | ||
int *stdlog; | ||
int *bnlog; | ||
int *ttlog; | ||
int tthours; | ||
int *stdlog; | ||
int *bnlog; | ||
int *ttlog; | ||
int tthours; | ||
|
||
stdlog = ccl_addlog(data->chosen); | ||
bnlog = ccl_addlog(data->bonus); | ||
|
@@ -137,7 +137,7 @@ static void print_info(t_data *data) | |
|
||
void print_result(t_data *data) | ||
{ | ||
int i; | ||
int i; | ||
|
||
i = 0; | ||
if (data->chosen && data->show_dates == 1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,15 @@ | |
/* By: hanmpark <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/12/18 19:13:07 by hanmpark #+# #+# */ | ||
/* Updated: 2023/03/14 01:21:02 by hanmpark ### ########.fr */ | ||
/* Updated: 2023/05/10 11:58:17 by hanmpark ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "scholarship_logtime.h" | ||
#include "get_next_line.h" | ||
#include "find_time.h" | ||
#include "parse.h" | ||
#include "print.h" | ||
|
||
static void write_holidays(char **tab, int year, int i, int fd) | ||
{ | ||
|
@@ -36,7 +37,10 @@ static void sort_holidays(char **tab, int fd) | |
i = 0; | ||
while (tab[i] && atoi(tab[i] + 2) != current_year()) | ||
i++; | ||
while (tab[i] && atoi(tab[i] + 7) < current_month()) | ||
while (tab[i] && atoi(tab[i] + 7) < current_month()) { | ||
i++; | ||
} | ||
while (tab[i] && atoi(tab[i + 1] + 7) == current_month()) | ||
i++; | ||
write_holidays(tab, current_year(), i, fd); | ||
while (tab[i] && atoi(tab[i] + 2) != current_year() - 1) | ||
|