-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdate.html
More file actions
110 lines (97 loc) · 3.66 KB
/
Copy pathdate.html
File metadata and controls
110 lines (97 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover, shrink-to-fit=no">
<meta name="description" content="Suha - Multipurpose E-commerce Mobile HTML Template">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="theme-color" content="#625AFA">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- The above tags *must* come first in the head, any other head content must come *after* these tags -->
<center><img src="img/date.png" alt="date" width="40%" height="auto">
<div id="date">
<script>
const daysOfWeek = [
"রবিবার",
"সোমবার",
"মঙ্গলবার",
"বুধবার",
"বৃহস্পতিবার",
"শুক্রবার",
"শনিবার",
];
const monthsOfYear = [
"জানুয়ারি",
"ফেব্রুয়ারি",
"মার্চ",
"এপ্রিল",
"মে",
"জুন",
"জুলাই",
"আগস্ট",
"সেপ্টেম্বর",
"অক্টোবর",
"নভেম্বর",
"ডিসেম্বর",
];
const numBd = ["০", "১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯"];
const date = new Date();
const dayOfWeek = daysOfWeek[date.getDay()];
const month = monthsOfYear[date.getMonth()];
let dayOfMonth = date
.getDate()
.toString()
.split("")
.map((v) => numBd[v])
.join("");
const year = date
.getFullYear()
.toString()
.split("")
.map((v) => numBd[v])
.join("");
const hours = date.getHours();
const minutes = date.getMinutes();
let formattedHours = hours < 10 ? `0${hours}` : hours;
if (hours > 12 && hours - 12 < 10) {
formattedHours = `0${hours - 12}`;
} else if (hours > 12 && hours - 12 >= 10) {
formattedHours = hours - 12;
}
formattedHours = formattedHours
.toString()
.split("")
.map((v) => numBd[v])
.join("");
let formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;
formattedMinutes = formattedMinutes
.toString()
.split("")
.map((v) => numBd[v])
.join("");
let bela = "";
if (hours == 4 || hours < 7) {
bela = "ভোর";
} else if (hours == 7 || hours < 10) {
bela = "সকাল";
} else if (hours == 10 || hours < 15) {
bela = "বেলা";
} else if (hours == 15 || hours < 18) {
bela = "বিকাল";
} else if (hours == 18 || hours < 20) {
bela = "সন্ধ্যা";
} else if (hours >= 20 || hours < 4) {
bela = "রাত";
}
const formattedDate = ` <link rel="stylesheet" href="css/font-awesome.min.css"> আজ ${dayOfMonth} ${month} ${year}, `;
document.getElementById("date").innerHTML = formattedDate;
</script>
<span id="timeNowBuet" style=""> </span><span id="date-today"></span></center>
<script src='js/jquery.min.js'></script>
<script src='js/buetDateTime.js'></script>
<script id="rendered-js" >
var data = new buetDateConverter().convert(" l, j F, Y (বঙ্গাব্দ)");
var $timeNowBuet = $('#timeNowBuet');
$timeNowBuet.html(data);
</script>