truncate method

  1. @useResult
LocalDate truncate({
  1. required DateUnit to,
})

Returns a copy of this truncated to the given DateUnit.

LocalDate(2023, 4, 15).truncate(to: DateUnit.months); // 2023-04-01

Implementation

@useResult LocalDate truncate({required DateUnit to}) => LocalDate._(_native.truncate(to: to));