Commit 9ec25f0b authored by rifkaki's avatar rifkaki

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 9800dcfe e15ac065
......@@ -310,11 +310,11 @@ export default class OutlookPA extends Component {
let data = []
response.data.data.map((item) => {
if (this.state.isApprover) {
if (item >= 2000 && item <= (Number(currentYear) + 10)) {
if (item >= 2000 && item <= (Number(currentYear) + 1)) {
data.push(item)
}
} else {
if ((item >= 2000) && (item == this.state.lastPeriod || item < this.state.lastPeriod)) {
if ((item >= 2000) && (item == Number(this.state.lastPeriod) + 1 || item < Number(this.state.lastPeriod) + 1)) {
data.push(item)
}
}
......@@ -328,11 +328,11 @@ export default class OutlookPA extends Component {
options: periodeData,
getOptionLabel: (option) => option.periode,
};
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 10) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : Number(this.state.lastPeriod) + 1)
let index = data.sort((a, b) => a - b).findIndex((val) => val == periode)
// console.log(data)
// console.log(this.state.lastPeriod)
// console.log(periodeData)
// console.log(periode)
// console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
if (this.state.isApprover === true) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment