Commit b62ff347 authored by d.arizona's avatar d.arizona

update

parent 344c5b7e
......@@ -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) {
......
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