|
@@ -51,6 +51,11 @@ class PunchClocks extends Component {
|
|
|
clockId: "",
|
|
|
dateList: [],
|
|
|
isCalendar: true,
|
|
|
+
|
|
|
+ year: new Date().getFullYear(),
|
|
|
+ month: new Date().getMonth() + 1,
|
|
|
+ day: new Date().getDate(),
|
|
|
+
|
|
|
}
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
this.publicReleaseClockIn = this.publicReleaseClockIn.bind(this);
|
|
@@ -204,6 +209,9 @@ class PunchClocks extends Component {
|
|
|
this.imagePickerRef && this.imagePickerRef.clear();
|
|
|
this.setState({
|
|
|
dateSel: dayjs().format('YYYY-MM-DD'),
|
|
|
+ year: new Date().getFullYear(),
|
|
|
+ month: new Date().getMonth() + 1,
|
|
|
+ day: new Date().getDate(),
|
|
|
duration: "",
|
|
|
selectorChecked: {},
|
|
|
remark: "",
|
|
@@ -220,8 +228,12 @@ class PunchClocks extends Component {
|
|
|
|
|
|
onSelectDate(val) {
|
|
|
let data = val.detail;
|
|
|
+ let date = dayjs(data)
|
|
|
this.setState({
|
|
|
- dateSel: data
|
|
|
+ dateSel: data,
|
|
|
+ year: date.year(),
|
|
|
+ month: date.month() + 1,
|
|
|
+ day: date.date(),
|
|
|
}, () => {
|
|
|
this.onmyDuration()
|
|
|
})
|
|
@@ -233,7 +245,7 @@ class PunchClocks extends Component {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- const { data, dateList } = this.state;
|
|
|
+ const { data, dateList, year, month, day } = this.state;
|
|
|
return (
|
|
|
<View className='punchClock'>
|
|
|
<View className='header'>
|
|
@@ -302,10 +314,10 @@ class PunchClocks extends Component {
|
|
|
this.state.isCalendar &&
|
|
|
<calendar
|
|
|
use_date_arr={dateList}
|
|
|
- year={new Date().getFullYear()}
|
|
|
- month={new Date().getMonth() + 1}
|
|
|
- nowMonth={new Date().getMonth() + 1}
|
|
|
- nowDay={new Date().getDate()}
|
|
|
+ year={year}
|
|
|
+ month={month}
|
|
|
+ nowMonth={month}
|
|
|
+ nowDay={day}
|
|
|
onselectdate={(v) => {
|
|
|
this.onSelectDate(v)
|
|
|
}}
|