code_corps v0.0.1 CodeCorps.Validators.TimeValidator View Source

Used for validating timestamp fields in a given changeset.

Link to this section Summary

Functions

Validates the new time is not before the previous time

Link to this section Functions

Link to this function truncate(datetime, precision) View Source
truncate(DateTime.t(), :microsecond | :millisecond | :second) :: DateTime.t()
Link to this function validate_time_not_before(changeset, field) View Source

Validates the new time is not before the previous time.

Works at second-level accuracy by truncating both timestamps to the second.