toastui icon indicating copy to clipboard operation
toastui copied to clipboard

Removing dates from the weekly calendar

Open RoshanPShetty opened this issue 3 years ago • 2 comments

Hi. Thank you for creating this wonderful htmlwidget.

I have the created a weekly calendar below:

library(toastui)
calendar(view="week", defaultDate = NULL) %>% cal_week_options(workweek = TRUE, hourStart = 7.5, hourEnd = 24)

This line of the code gives the following output: enter image description here

How can I remove the dates i.e. 21, 22, 23, 24, 25 and just have Monday-Friday as the labels? I am trying use cal_template but I am not sure how that works for R as the documentation is for JS . Any help would be appreciated!

RoshanPShetty avatar Jun 28 '21 16:06 RoshanPShetty

Hello, Have you succeeded ?

Here's a solution with using cal_template() :

library(toastui)
calendar(view="week", defaultDate = NULL) %>% 
  cal_week_options(workweek = TRUE, hourStart = 7.5, hourEnd = 24) %>% 
  cal_template(
    weekDayname = JS(
      "function(model) {",
      "var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];",
      "return '<span class=\"tui-full-calendar-dayname-name\">' + days[model.day] + '</span>';",
      "}"
    )
  )

Victor

pvictor avatar Jun 30 '21 08:06 pvictor

@pvictor I did succeed in creating it! Thank you so much!

RoshanPShetty avatar Jun 30 '21 20:06 RoshanPShetty