amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Change language dynamically #1251

Open Lechucico opened 6 months ago

Lechucico commented 6 months ago

I'm trying to change language dynamically, but nothing changes after creating a new instance, here is the code:

// Default english
var datePicker = $('.datepicker').pickadate({
  today: null,
  clear: null,
  formatSubmit: 'dd/mm/yyyy',            
})

After changing language, I create a new instance with the new translations, but the same English modal opens:

var datePicker = $('.datepicker').pickadate({
  today: null,
  clear: null,
  formatSubmit: 'dd/mm/yyyy',    
  monthsFull: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'],
  weekdaysShort: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
  formatSubmit: 'yyyy/mm/dd'
})