Have a look at this custom function monthStart
below which can be used to force the date to the first date of that month and year
Example 1, Display the first day of a given month. This may be useful if you want to use the date object for later use in your app, so it will always point to the first day of a given month and year
#rm(list=ls())
library(shiny)
monthStart <- function(x) {
x <- as.POSIXlt(x)
x$mday <- 1
as.Date(x)
}
ui <- basicPage(dateRangeInput('dateRange',label = "Pédiode d'analyse : ",format = "mm/yyyy",language="fr",start = Sys.Date(), end=Sys.Date(),startview = "year",separator = " - "),
textOutput("SliderText")
)
server <- shinyServer(function(input, output, session){
Dates <- reactiveValues()
observe({
Dates$SelectedDates <- c(as.character(monthStart(input$dateRange[1])),as.character(monthStart(input$dateRange[2])))
})
output$SliderText <- renderText({Dates$SelectedDates})
})
shinyApp(ui = ui, server = server)

Example 2, Display only the month and year
#rm(list=ls())
library(shiny)
monthStart <- function(x) {
x <- as.POSIXlt(x)
x$mday <- 1
as.Date(x)
}
ui <- basicPage(dateRangeInput('dateRange',label = "Pédiode d'analyse : ",format = "mm/yyyy",language="fr",start = Sys.Date(), end=Sys.Date(),startview = "year",separator = " - "),
textOutput("SliderText")
)
server <- shinyServer(function(input, output, session){
Dates <- reactiveValues()
observe({
Dates$SelectedDates <- c(as.character(format(input$dateRange[1],format = "%m/%Y")),as.character(format(input$dateRange[2],format = "%m/%Y")))
})
output$SliderText <- renderText({Dates$SelectedDates})
})
shinyApp(ui = ui, server = server)
