Skip to content

Commit

Permalink
Fixed for holidays, only had 1 holiday for May ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
hanmpark committed May 10, 2023
1 parent edcaae8 commit 70b0288
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion inc/scholarship_logtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand All @@ -18,6 +18,8 @@
# define HOLIDAYS 1
# define DATES 0

# define INFO_BONUS 1

typedef struct s_data
{
char **chosen;
Expand Down
12 changes: 6 additions & 6 deletions src/logtime/print_logtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions src/parse_data/parse_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down

0 comments on commit 70b0288

Please sign in to comment.