Skip to content

Commit

Permalink
feat: datepicker utils move to common (#218)
Browse files Browse the repository at this point in the history
* feat: datepicker utils move to common

* feat: rename date-picker util path

* feat: update common

* feat: update common

* feat: update common
  • Loading branch information
xiaosansiji committed Jan 12, 2022
1 parent 92e3471 commit 2e9a06b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 455 deletions.
2 changes: 1 addition & 1 deletion src/_common
2 changes: 1 addition & 1 deletion src/date-picker/date-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import TDate from './panel/date';
import TDateRange from './panel/date-range';
import TTimePickerPanel from '../time-picker/panel';
import { EPickerCols } from '../time-picker/interface';
import { firstUpperCase, extractTimeFormat } from './utils';
import { firstUpperCase, extractTimeFormat } from '../_common/js/date-picker/utils';
import { TimePickerPanelInstance } from '../time-picker';
import { DatePickerInstance, DateValue, PickContext } from './interface';
import { renderTNodeJSX } from '../utils/render-tnode';
Expand Down
8 changes: 2 additions & 6 deletions src/date-picker/panel/date-range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
getToday,
firstUpperCase,
setDateTime,
} from '../utils';
} from '../../_common/js/date-picker/utils';
import props from '../props';

const TODAY = getToday();
Expand Down Expand Up @@ -291,11 +291,7 @@ export default Vue.extend<DateRangeData, DateRangeMethods, DateRangeComputed, Da
},
},
render() {
const {
leftType,
rightType,
firstDayOfWeek,
} = this;
const { leftType, rightType, firstDayOfWeek } = this;
return (
<div class={`${prefix}-date-picker__panels`}>
<div class={`${prefix}-date-picker__panel`}>
Expand Down
4 changes: 2 additions & 2 deletions src/date-picker/panel/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
getToday,
firstUpperCase,
OptionsType,
} from '../utils';
} from '../../_common/js/date-picker/utils';

export default Vue.extend<DateData, DateMethods, DateComputed, DateProps>({
name: 'TDatePanel',
Expand Down Expand Up @@ -77,7 +77,7 @@ export default Vue.extend<DateData, DateMethods, DateComputed, DateProps>({
default:
break;
}
const start = (type === 'date' || type === mode) ? value : new Date(year, month);
const start = type === 'date' || type === mode ? value : new Date(year, month);
return flagActive(data, { start, type });
},
},
Expand Down
Loading

0 comments on commit 2e9a06b

Please sign in to comment.