Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

DateRangePicker Language Locale Turkish


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()
};


to this;


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()
};


in view.js

Change this;


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);


to this;


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);


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi happy,

Thank you for sharing this. Really helpful tip.
All the best with your projects!

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(