'How to only select month and year in a shiny widget

My normal Shiny date widget offers date selection by year-month-day. REPREX:

# Load library

library(shiny)
library(dplyr)

# Load data & prepare data

data(economics)

dat <- economics %>% filter(date > '2014-01-01')


# Define UI 

ui <- fluidPage(
     
     dateRangeInput(
          
          inputId = 'enter_dt',
          label = 'select timeframe:',
          start = max(dat$date),
          end = min(dat$date) ,

     )
)

# Define server 

server <- function(input, output) {
     
    
}

# Run the application 

shinyApp(ui = ui, server = server)

Above code gives me this:

enter image description here

I am trying to get a widget which only offers year-month like this:

enter image description here

Please advise.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source