From 1707e914c4ac2fd83de58e8c84984983115fa3ae Mon Sep 17 00:00:00 2001 From: Mohamed Sayed Date: Thu, 17 Aug 2023 14:47:03 +0300 Subject: [PATCH] Fix dmy function Day should be the first number in the regex group --- src/TidierDates.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TidierDates.jl b/src/TidierDates.jl index d12c42e..ca44ff0 100644 --- a/src/TidierDates.jl +++ b/src/TidierDates.jl @@ -118,7 +118,7 @@ function dmy(date_string::Union{AbstractString, Missing}) m = match(r"(\d{1,2})[/-](\d{1,2})[/-](\d{4})", date_string) if m !== nothing - month_str, day_str, year_str = m.captures + day_str, month_str, year_str = m.captures month = parse(Int, month_str) day = parse(Int, day_str) year = parse(Int, year_str) @@ -406,4 +406,4 @@ function difftime(time1::Union{DateTime, Missing}, time2::Union{DateTime, Missin return result end -end \ No newline at end of file +end