Skip to content

Commit

Permalink
Merge pull request #321 from JanCVanB/snake-ify_datetimeHelp
Browse files Browse the repository at this point in the history
Snake-case-ify epoch_millis_to_datetimeHelp function name
  • Loading branch information
Anton-4 authored Jan 31, 2025
2 parents 717caa3 + 9294574 commit 60afeff
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions platform/InternalDateTime.roc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ epoch_millis_to_datetime = |millis|
month = 1
year = 1970

epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{
year,
month,
Expand All @@ -111,8 +111,8 @@ epoch_millis_to_datetime = |millis|
},
)

epoch_millis_to_datetimeHelp : DateTime -> DateTime
epoch_millis_to_datetimeHelp = |current|
epoch_millis_to_datetime_help : DateTime -> DateTime
epoch_millis_to_datetime_help = |current|
count_days_in_month = days_in_month(current.year, current.month)
count_days_in_prev_month =
if current.month == 1 then
Expand All @@ -121,36 +121,36 @@ epoch_millis_to_datetimeHelp = |current|
days_in_month(current.year, (current.month - 1))

if current.day < 1 then
epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{ current &
year: if current.month == 1 then current.year - 1 else current.year,
month: if current.month == 1 then 12 else current.month - 1,
day: current.day + count_days_in_prev_month,
},
)
else if current.hours < 0 then
epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{ current &
day: current.day - 1,
hours: current.hours + 24,
},
)
else if current.minutes < 0 then
epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{ current &
hours: current.hours - 1,
minutes: current.minutes + 60,
},
)
else if current.seconds < 0 then
epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{ current &
minutes: current.minutes - 1,
seconds: current.seconds + 60,
},
)
else if current.day > count_days_in_month then
epoch_millis_to_datetimeHelp(
epoch_millis_to_datetime_help(
{ current &
year: if current.month == 12 then current.year + 1 else current.year,
month: if current.month == 12 then 1 else current.month + 1,
Expand Down

0 comments on commit 60afeff

Please sign in to comment.