Hi. If somebody wants to use DateRangePicker language as Turkish can use this.
in plugins.bundle.js
Change this;
this.locale = {
direction: "ltr",
format: moment.localeData().longDateFormat("L"),
separator: " - ",
applyLabel: "Apply",
cancelLabel: "Cancel",
weekLabel: "W",
customRangeLabel: "Custom Range",
daysOfWeek: moment.weekdaysMin(),
monthNames: moment.monthsShort(),
firstDay: moment.localeData().firstDayOfWeek()
};
this.locale = {
direction: "ltr",
format: "DD/MM/YYYY",
separator: " - ",
applyLabel: "Uygula",
cancelLabel: "Vazgeç",
weekLabel: "W",
customRangeLabel: "Tarih Aralığı",
daysOfWeek: ["Pa", "Pt", "Sa", "Ça", "Pe", "Cu", "Cmt"],
monthNames: ["Ocak", "Åžubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "AÄŸustos", "Eylül", "Ekim", "Kasım", "Aralık"],
firstDay: moment.localeData().firstDayOfWeek()
};
input.daterangepicker({
startDate: start,
endDate: end,
ranges: {
"Today": [moment(), moment()],
"Yesterday": [moment().subtract(1, "days"), moment().subtract(1, "days")],
"Last 7 Days": [moment().subtract(6, "days"), moment()],
"Last 30 Days": [moment().subtract(29, "days"), moment()],
"This Month": [moment().startOf("month"), moment().endOf("month")],
"Last Month": [moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]
}
}, cb);
input.daterangepicker({
startDate: start,
endDate: end,
ranges: {
"Bugün": [moment(), moment()],
"Dün": [moment().subtract(1, "days"), moment().subtract(1, "days")],
"Son 7 Gün": [moment().subtract(6, "days"), moment()],
"Son 30 Gün": [moment().subtract(29, "days"), moment()],
"Bu Ay": [moment().startOf("month"), moment().endOf("month")],
"Önceki Ay": [moment().subtract(1, "month").startOf("month"), moment().subtract(1, "month").endOf("month")]
}
}, cb);
Hi ,
Thank you for sharing this. Really helpful tip.
All the best with your projects!
Regards.