Test date validity

dates

#1

Is there a way to test the validity of a date other than

function test_date(y::Int, m::Int, d::Int)::Nullable{Date}
    try
        return Nullable{Date}(Date(y, m, d))
    catch
        return Nullable{Date}()
    end
end

Seems like there should be a simple test function?


#2

See Dates.validargs.


#3

Hmm, can’t find it :confused:


#4

sorry, only in v0.6. In v0.5.2, look at @edit Date(2000,1,1), and you can construct a test using the source which has not been factored out in that version.


#5

Oh great, ok. I’m on Version 0.6.0-dev.1393 but I’ll gladly update! Thanks