Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dates from the weekly calendar #4

Open
RoshanPShetty opened this issue Jun 28, 2021 · 2 comments
Open

Removing dates from the weekly calendar #4

RoshanPShetty opened this issue Jun 28, 2021 · 2 comments

Comments

@RoshanPShetty
Copy link

RoshanPShetty commented Jun 28, 2021

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!

@pvictor
Copy link
Member

pvictor commented Jun 30, 2021

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

@RoshanPShetty
Copy link
Author

RoshanPShetty commented Jun 30, 2021

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

@RoshanPShetty RoshanPShetty reopened this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants