-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDateTimeShowInBangla.min.js
1 lines (1 loc) · 1.24 KB
/
DateTimeShowInBangla.min.js
1
const DateShowInBangla = function () { let t, e, n, o, r, a, l, u, g, i, c = {}; const f = ["জানুয়ারী", "ফেব্রুয়ারী", "মার্স", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টবর", "নভেম্বর", "ডিসেম্বর"], D = ["০", "১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯"], s = function (e) { 12 == t && (n > 12 ? (g = "PM", 12 == (n -= 12) && (n = 0, g = "AM")) : n < 12 ? g = "AM" : 12 == n && (g = "PM")); let o = "", r = function (t) { let e = t; return t < 10 && (e = "0" + t), e.toString() }(e); for (let t = 0; t < r.length; t++)o += D[parseInt(r[t])]; return o }, M = function () { let t = "", e = ""; return c.onlyTime || (e = s(u) + " " + f[l - 1] + " " + s(a)), c.onlyDate || (t = s(n) + ":" + s(o) + ":" + s(r) + " " + (i = "AM" == g ? "পূর্বাহ্ণ " : "অপরাহ্ণ")), e + " " + t }; return { init: function (g = {}) { return c = g, console.log(c.myDate), t = c.format ? c.format : 12, e = c.myDate ? new Date(c.myDate) : new Date, a = e.getFullYear(), l = e.getMonth() + 1, u = e.getDate(), n = e.getHours(), o = e.getMinutes(), r = e.getSeconds(), M() } } }();