Skip to main content

Module layout

Module layout 

Source
Available on crate feature calendar only.
Expand description

Where things go: the weeks of a month, the lanes of bars across days and the side by side columns of overlapping entries in a day.

Structs§

Bar
An occurrence laid across a row of days.
Block
A timed occurrence in one day of the time grid.
Fitted
Bars cut down to the lanes there is room for.
Grid
The geometry of a time grid: day columns beside a gutter of hour labels, one row per hour.

Constants§

BLOCK_GAP
The space between neighbouring blocks.
BLOCK_GUTTER
The part of a day column blocks leave free on the right.
DAY_MINUTES
Minutes in a day on the time grid.
MIN_BLOCK_MINUTES
The shortest a block is drawn, so a five minute entry can still be read and grabbed. Blocks also keep clear of each other by this much.

Functions§

bars
Lays occurrences across days, which are consecutive dates. Longer bars go first so they stay in one piece near the top, and each bar takes the highest lane that is free for all its days.
blocks
The timed occurrences on date as blocks. Entries that overlap share the width in columns; a run of entries that touch one another uses as many columns as its busiest moment needs.
fit
Keeps the bars that fit in lanes lines over days days. A day with more bars than lines gives its last line to a count of the rest, so a bar on that line is hidden if any of its days is that full.
instant_at
The instant minute minutes into date.
lane_count
How many lanes bars use.
minute_on
The minute of date that instant falls on: 0 when it is before the day and DAY_MINUTES when it is after.
month_weeks
The weeks that cover the month of date, four to six of them.
snap
minutes rounded to the nearest step, kept within the day.
week_of
The seven dates of the week holding date, starting on week_start.
weekdays
The seven weekdays in order, starting on week_start.