Skip to content

Commit e1415df

Browse files
committed
fix(function): Reorder formatter so that seconds is before month
S in sep renders the seconds in place of the S ref: #40 #42 nofusscomputing/centurion_erp#466
1 parent 425b22e commit e1415df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/functions/FieldData.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ export default function FieldData({
126126
ddd: this.toLocaleDateString('default', { weekday: 'short' }),
127127
dd: this.getDate().toString().padStart(2, '0'),
128128
d: this.getDate(),
129+
// `S` must be before month, as Sep with be processed as `#ep`
130+
SS: this.getSeconds().toString().padStart(2, '0'),
131+
S: this.getSeconds(),
132+
ss: this.getSeconds().toString().padStart(2, '0'),
133+
s: this.getSeconds(),
129134
MMMM: this.toLocaleString('default', { month: 'long' }),
130135
MMM: this.toLocaleString('default', { month: 'short' }),
131136
MM: (this.getMonth() + 1).toString().padStart(2, '0'),
@@ -136,10 +141,6 @@ export default function FieldData({
136141
h: (this.getHours() % 12).toString(),
137142
mm: this.getMinutes().toString().padStart(2, '0'),
138143
m: this.getMinutes(),
139-
SS: this.getSeconds().toString().padStart(2, '0'),
140-
S: this.getSeconds(),
141-
ss: this.getSeconds().toString().padStart(2, '0'),
142-
s: this.getSeconds(),
143144
TTT: this.getMilliseconds().toString().padStart(3, '0'),
144145
ttt: this.getMilliseconds().toString().padStart(3, '0'),
145146
AMPM: this.getHours() < 13 ? 'AM' : 'PM',

0 commit comments

Comments
 (0)