valid!units(value) is false.enforceValid
fn
void enforceValid(string units)(int value, string file = __FILE__, size_t line = __LINE__) if (units == "months" ||
units == "hours" ||
units == "minutes" ||
units == "seconds") @safe pureParameters
units | The units of time to validate. |
value | The number to validate. |
file | The file that the DateTimeException will list if thrown. |
line | The line number that the DateTimeException will list if thrown. |
Throws
DateTimeException if
fn
void enforceValid(string units)(int year, Month month, int day, string file = __FILE__, size_t line = __LINE__) if (units == "days") @safe pureBecause the validity of the day number depends on both on the year and month of which the day is occurring, take all three variables to validate the day.
Parameters
units | The units of time to validate. |
year | The year of the day to validate. |
month | The month of the day to validate. |
day | The day to validate. |
file | The file that the DateTimeException will list if thrown. |
line | The line number that the DateTimeException will list if thrown. |
Throws
DateTimeException if
valid!"days"(year, month, day) is false.