Browse Source

fix:update format date

pull/1/head
wahyun 4 months ago
parent
commit
313c7e5e72
  1. 13
      edit-mode/function/function.js

13
edit-mode/function/function.js

@ -314,16 +314,17 @@ function formatReplaceTitikRibuan(param) {
} }
function formatDate(params) { function formatDate(params) {
const months = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
];
let today = new Date(params); let today = new Date(params);
let yyyy = today.getFullYear(); let yyyy = today.getFullYear();
let mm = today.getMonth() + 1; // Months start at 0! let mm = today.getMonth(); // Bulan dimulai dari 0!
let dd = today.getDate(); let dd = today.getDate();
if (dd < 10) dd = '0' + dd; return `${dd} ${months[mm]} ${yyyy}`;
if (mm < 10) mm = '0' + mm;
today = dd + '/' + mm + '/' + yyyy;
return today;
} }
function roundToTwo(num) { function roundToTwo(num) {

Loading…
Cancel
Save