JSFiddle - React, Tailwind, and code Playground

by azhigimont

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/cultures/wijmo.culture.th.min.js"></script>

JavaScript

let dateObj = new Date(2024,2,17);
let formattedDate = wijmo.Globalize.formatDate(dateObj, "yyyy MMMM dd dddd")
console.log(formattedDate);

thaiDateString = dateObj.toLocaleDateString("th-TH")
let [day, month, year] = thaiDateString.split('/').map(Number);
dateObj = new Date(year, month - 1, day); // month - 1 because JS months are zero-based
formattedDate = wijmo.Globalize.formatDate(dateObj, "yyyy MMMM dd dddd")
console.log(formattedDate);