Skip to content

Commit

Permalink
generateTimeSuffix problem solve
Browse files Browse the repository at this point in the history
  • Loading branch information
emrancu committed Nov 4, 2019
1 parent c49f61a commit f8bc25e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
7 changes: 2 additions & 5 deletions DateTimeShowInBangla.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ const DateShowInBangla = (function () {
TimeSufix = 'PM';
hour = (hour - 12);

if (hour < 10) {
result = "0" + hour;
} else if (hour == 12) {
hour = "00";
if (hour == 12) {
hour = 0;
TimeSufix = 'AM';
}
}
else if (hour < 12) {
result = ((hour < 10) ? "0" + hour : hour);
TimeSufix = 'AM';
} else if (hour == 12) {
TimeSufix = 'PM';
Expand Down
2 changes: 1 addition & 1 deletion DateTimeShowInBangla.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions es6.DateTimeShowInBangla.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,28 @@ const DateShowInBangla = (function () {
return StringNumber.toString();
}


const generateTimeSuffix = function () {

if (date_format == 12) {
if (hour > 12) {
TimeSufix = 'PM';
hour = (hour - 12);

if (hour < 10) {
result = "0" + hour;
} else if (hour == 12) {
hour = "00";
if (hour == 12) {
hour = 0;
TimeSufix = 'AM';
}
}
else if (hour < 12) {
result = ((hour < 10) ? "0" + hour : hour);
TimeSufix = 'AM';
} else if (hour == 12) {
TimeSufix = 'PM';
}
}
}


const convertBn = function (number) {
generateTimeSuffix();
let result = '';
Expand Down Expand Up @@ -86,5 +85,4 @@ const DateShowInBangla = (function () {
};
})()

export default DateShowInBangla ;

export default DateShowInBangla;

0 comments on commit f8bc25e

Please sign in to comment.