Options for buttons displayed above calendar
Usage
navigation_options(
today_label = "Today",
prev_label = ph("caret-left"),
next_label = ph("caret-right"),
class = "bttn-bordered bttn-sm bttn-primary",
bg = NULL,
color = NULL,
fmt_date = "YYYY-MM-DD",
sep_date = " ~ "
)
Arguments
- today_label
Text to display on today button.
- prev_label
Text to display on prev button.
- next_label
Text to display on next button.
- class
Class to add to buttons.
- bg, color
Background and text colors.
- fmt_date
Format for the date displayed next to the buttons, use dayjs library (see https://day.js.org/docs/en/display/format).
- sep_date
Separator to use between start date and end date.
Note
Buttons are generated with the following CSS library : http://bttn.surge.sh/,
where you can find available options for class
argument.
Examples
# Use another button style
calendar(
navigation = TRUE,
navOpts = navigation_options(
class = "bttn-stretch bttn-sm bttn-warning"
)
)
# Custom colors (background and text)
calendar(
navigation = TRUE,
navOpts = navigation_options(bg = "#FE2E2E", color = "#FFF")
)
# both
calendar(
navigation = TRUE,
navOpts = navigation_options(
bg = "#04B431", color = "#FFF",
class = "bttn-float bttn-md"
)
)
# Change date format and separator
calendar(
navigation = TRUE,
navOpts = navigation_options(
fmt_date = "DD/MM/YYYY",
sep_date = " - "
)
)