pub trait DateMethods: AsDate {
// Required method
fn parse_from_str_slice(
name: PlSmallStr,
v: &[&str],
fmt: &str,
) -> Logical<DateType, Int32Type>;
// Provided methods
fn year(&self) -> ChunkedArray<Int32Type> { ... }
fn is_leap_year(&self) -> ChunkedArray<BooleanType> { ... }
fn iso_year(&self) -> ChunkedArray<Int32Type> { ... }
fn quarter(&self) -> ChunkedArray<Int8Type> { ... }
fn month(&self) -> ChunkedArray<Int8Type> { ... }
fn days_in_month(&self) -> ChunkedArray<Int8Type> { ... }
fn week(&self) -> ChunkedArray<Int8Type> { ... }
fn day(&self) -> ChunkedArray<Int8Type> { ... }
fn ordinal(&self) -> ChunkedArray<Int16Type> { ... }
fn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
name: PlSmallStr,
) -> Result<Logical<DateType, Int32Type>, PolarsError> { ... }
}Required Methods§
fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, ) -> Logical<DateType, Int32Type>
Provided Methods§
Sourcefn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Extract month from underlying NaiveDate representation. Returns the year number in the calendar date.
Sourcefn is_leap_year(&self) -> ChunkedArray<BooleanType>
fn is_leap_year(&self) -> ChunkedArray<BooleanType>
Extract year from underlying NaiveDate representation. Returns whether the year is a leap year.
Sourcefn iso_year(&self) -> ChunkedArray<Int32Type>
fn iso_year(&self) -> ChunkedArray<Int32Type>
This year number might not match the calendar year number.
Sourcefn quarter(&self) -> ChunkedArray<Int8Type>
fn quarter(&self) -> ChunkedArray<Int8Type>
Extract month from underlying NaiveDateTime representation. Quarters range from 1 to 4.
Sourcefn month(&self) -> ChunkedArray<Int8Type>
fn month(&self) -> ChunkedArray<Int8Type>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
Sourcefn days_in_month(&self) -> ChunkedArray<Int8Type>
fn days_in_month(&self) -> ChunkedArray<Int8Type>
Returns the number of days in the month of the underlying NaiveDate representation.
Sourcefn week(&self) -> ChunkedArray<Int8Type>
fn week(&self) -> ChunkedArray<Int8Type>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
Sourcefn day(&self) -> ChunkedArray<Int8Type>
fn day(&self) -> ChunkedArray<Int8Type>
Extract day from underlying NaiveDate representation. Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
Sourcefn ordinal(&self) -> ChunkedArray<Int16Type>
fn ordinal(&self) -> ChunkedArray<Int16Type>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
Sourcefn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
name: PlSmallStr,
) -> Result<Logical<DateType, Int32Type>, PolarsError>
fn new_from_parts( year: &ChunkedArray<Int32Type>, month: &ChunkedArray<Int8Type>, day: &ChunkedArray<Int8Type>, name: PlSmallStr, ) -> Result<Logical<DateType, Int32Type>, PolarsError>
Construct a date ChunkedArray from individual time components.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".