I'm using bootstrap-datetimepicker and moment.js to manipulate the date and to generate a report. My application is capable of changing English to Thai language. The questions is how to convert this sample string "24-มิ.ย.-2015 00:00:00" to "24-June-2015 00:00:00" Pls. someone help how to do this in javascript?
I'm using bootstrap-datetimepicker and moment.js to manipulate the date and to generate a report. My application is capable of changing English to Thai language. The questions is how to convert this sample string "24-มิ.ย.-2015 00:00:00" to "24-June-2015 00:00:00" Pls. someone help how to do this in javascript?
Share Improve this question asked Jun 25, 2015 at 7:37 King AgustinKing Agustin 611 gold badge4 silver badges9 bronze badges 1- 1 Use a conversion table between Thai and English month names. – Bergi Commented Jun 25, 2015 at 7:41
1 Answer
Reset to default 2
var monthNamesThai = ["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน",
"กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤษจิกายน","ธันวาคม"];
var dayNames = ["วันอาทิตย์ที่","วันจันทร์ที่","วันอังคารที่","วันพุทธที่","วันพฤหัสบดีที่","วันศุกร์ที่","วันเสาร์ที่"];
var monthNamesEng = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
var dayNamesEng = ['Sunday','Monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
var d = new Date();
document.write("The current Date is " + dayNames[d.getDay()]+" "+d.getDate()+""+monthNamesThai[d.getMonth()]+" "+d.getFullYear()+" = "+ dayNamesEng[d.getDay()]+" "+d.getDate()+" " + monthNamesEng[d.getMonth()]+" "+d.getFullYear());