source: reactapp/src/Util/dateConverter.js

main
Last change on this file was 5347491, checked in by unknown <mlviktor23@…>, 2 years ago

styled professor page, added date translation to datePosted, added indentation for replies

  • Property mode set to 100644
File size: 830 bytes
Line 
1//date format == Jul 30 2022 14:06
2
3export const dateConverter = (date) => {
4 var months = [
5 "Jan",
6 "Feb",
7 "Mar",
8 "Apr",
9 "May",
10 "Jun",
11 "Jul",
12 "Aug",
13 "Sep",
14 "Oct",
15 "Nov",
16 "Dec",
17 ];
18 var meseci = [
19 "јануари",
20 "февруари",
21 "март",
22 "април",
23 "мај",
24 "јуни",
25 "јули",
26 "август",
27 "септември",
28 "октомври",
29 "ноември",
30 "декември",
31 ];
32
33 var datum = "";
34 var day = date.substring(4, 6);
35 datum = datum + day;
36 var month = date.substring(0, 3);
37 datum = datum + " " + meseci[months.indexOf(month)];
38 var year = date.substring(7, 11);
39 datum = datum + " " + year;
40 var time = date.substring(12, 17);
41 datum = datum + " " + "во" + " " + time;
42
43 return datum;
44};
Note: See TracBrowser for help on using the repository browser.