toastui icon indicating copy to clipboard operation
toastui copied to clipboard

Removing current time indicator

Open RoshanPShetty opened this issue 3 years ago • 4 comments

Hi @pvictor. The current time indicator isn't shown when it isn't the systems date/time. But when it is, then it is shown. So is it possible to remove the current time indicator from the calendar? If so, could you please indicate how it is done?

Here is a snippet when the defaultDate is NOT Sys.Date(): image

Here is a snippet when the defaultDate is Sys.Date(): image

RoshanPShetty avatar Jul 03 '21 01:07 RoshanPShetty

Hello,

There isn't a built-in option to do that, so a workaround is to use theme and template like this:

calendar(view = "week") %>% 
      cal_theme(
        week.currentTimeLinePast.border = "none",
        week.currentTimeLineBullet.backgroundColor = "transparent",
        week.currentTimeLineToday.border = "none",
        week.currentTimeLineFuture.border = "none"
      ) %>% 
      cal_template(
        timegridCurrentTime = JS(
          "function() {return null;}"
        )
      )

Note that the regular hour is missing, you can make it reappear with some CSS:

.tui-full-calendar-timegrid-hour span {
    display: block !important;
}

In Shiny for example, include somewhere in your UI the following code:

tags$style(
    ".tui-full-calendar-timegrid-hour span {display: block !important;}"
  )

Victor

pvictor avatar Jul 05 '21 15:07 pvictor

Hi @pvictor . Thank you for such a creative solution. However, there is one minor issue with that. Although it gets rid of the indicator, if the time has passed, then the calendar looks like this:

image

Would I need to work with CSS to bring it back to its original state?

image

RoshanPShetty avatar Jul 05 '21 20:07 RoshanPShetty

You can add

week.pastDay.color = "#000",
week.pastTime.color = "#000"

in cal_theme() to set color for past time and days to black.

pvictor avatar Jul 06 '21 06:07 pvictor

Thank you!

RoshanPShetty avatar Jul 06 '21 17:07 RoshanPShetty