Skip to content

Commit

Permalink
2 digit year with slice(-2)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhood125ruhuc committed Feb 20, 2025
1 parent 78258db commit f717249
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/buddhistEra/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default (o, c) => { // locale needed later
const result = str.replace(/BBBB|BB/g, (match) => {
switch (match) {
case 'BB':
return utils.padStart(String((this.$y + yearBias) % 100), 2, '0')
return utils.padStart(String(this.$y + yearBias).slice(-2), 2, '0')
default: // BBBB
return utils.padStart(String(this.$y + yearBias), 4, '0')
}
Expand Down

0 comments on commit f717249

Please sign in to comment.