@94ai/nf-double-half-year 3.2.48 → 3.2.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +52 -52
- package/lib/nf-double-half-year.cjs.js +136 -3626
- package/lib/nf-double-half-year.esm-bundler.js +136 -3626
- package/lib/nf-double-half-year.vue.d.ts +18 -18
- package/package/nf-double-half-year.vue +1 -1
- package/package/nf-half-year-picker-item.vue +1 -1
- package/package.json +4 -3
- package/lib/util.d.ts +0 -5
- package/package/util.ts +0 -58
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { HalfYearItem } from './types';
|
|
2
2
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
3
|
+
offset: {
|
|
4
|
+
type: import("vue-demi").PropType<number>;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
transition: {
|
|
8
|
+
type: import("vue-demi").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
3
11
|
value: {
|
|
4
12
|
type: import("vue-demi").PropType<string[]>;
|
|
5
13
|
default: undefined;
|
|
@@ -47,10 +55,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
47
55
|
type: import("vue-demi").PropType<string>;
|
|
48
56
|
default: string;
|
|
49
57
|
};
|
|
50
|
-
transition: {
|
|
51
|
-
type: import("vue-demi").PropType<string>;
|
|
52
|
-
default: string;
|
|
53
|
-
};
|
|
54
58
|
placement: {
|
|
55
59
|
type: import("vue-demi").PropType<string>;
|
|
56
60
|
default: string;
|
|
@@ -63,10 +67,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
63
67
|
type: import("vue-demi").PropType<string>;
|
|
64
68
|
default: string;
|
|
65
69
|
};
|
|
66
|
-
offset: {
|
|
67
|
-
type: import("vue-demi").PropType<number>;
|
|
68
|
-
default: number;
|
|
69
|
-
};
|
|
70
70
|
visibleArrow: {
|
|
71
71
|
type: import("vue-demi").PropType<boolean>;
|
|
72
72
|
default: boolean;
|
|
@@ -104,6 +104,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
104
104
|
blur: (value: any) => void;
|
|
105
105
|
focus: (value: any) => void;
|
|
106
106
|
}, string, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
107
|
+
offset: {
|
|
108
|
+
type: import("vue-demi").PropType<number>;
|
|
109
|
+
default: number;
|
|
110
|
+
};
|
|
111
|
+
transition: {
|
|
112
|
+
type: import("vue-demi").PropType<string>;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
107
115
|
value: {
|
|
108
116
|
type: import("vue-demi").PropType<string[]>;
|
|
109
117
|
default: undefined;
|
|
@@ -151,10 +159,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
151
159
|
type: import("vue-demi").PropType<string>;
|
|
152
160
|
default: string;
|
|
153
161
|
};
|
|
154
|
-
transition: {
|
|
155
|
-
type: import("vue-demi").PropType<string>;
|
|
156
|
-
default: string;
|
|
157
|
-
};
|
|
158
162
|
placement: {
|
|
159
163
|
type: import("vue-demi").PropType<string>;
|
|
160
164
|
default: string;
|
|
@@ -167,10 +171,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
167
171
|
type: import("vue-demi").PropType<string>;
|
|
168
172
|
default: string;
|
|
169
173
|
};
|
|
170
|
-
offset: {
|
|
171
|
-
type: import("vue-demi").PropType<number>;
|
|
172
|
-
default: number;
|
|
173
|
-
};
|
|
174
174
|
visibleArrow: {
|
|
175
175
|
type: import("vue-demi").PropType<boolean>;
|
|
176
176
|
default: boolean;
|
|
@@ -195,6 +195,8 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
195
195
|
default: boolean;
|
|
196
196
|
};
|
|
197
197
|
}>>, {
|
|
198
|
+
offset: number;
|
|
199
|
+
transition: string;
|
|
198
200
|
value: string[];
|
|
199
201
|
tabindex: number;
|
|
200
202
|
rangeSeparator: string;
|
|
@@ -206,11 +208,9 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
206
208
|
disabled: boolean;
|
|
207
209
|
prefixIcon: string;
|
|
208
210
|
clearIcon: string;
|
|
209
|
-
transition: string;
|
|
210
211
|
placement: string;
|
|
211
212
|
popperClass: string;
|
|
212
213
|
trigger: string;
|
|
213
|
-
offset: number;
|
|
214
214
|
visibleArrow: boolean;
|
|
215
215
|
popperOptions: Object;
|
|
216
216
|
openDelay: number;
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
} from 'vue-demi'
|
|
47
47
|
import { halfYearOptions } from './config'
|
|
48
48
|
import { HalfYearItem } from './types'
|
|
49
|
-
import { getHalfYear } from '
|
|
49
|
+
import { getHalfYear } from '@94ai/common-utils'
|
|
50
50
|
|
|
51
51
|
const props = withDefaults(defineProps<{
|
|
52
52
|
// 当前年
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-double-half-year",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.49",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/
|
|
17
|
+
"@94ai/common-utils": "^3.2.49",
|
|
18
|
+
"@94ai/nf-theme-chalk": "^3.2.49",
|
|
18
19
|
"vue-demi": "^0.14.5"
|
|
19
20
|
},
|
|
20
21
|
"peerDependenciesMeta": {
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
"types": "lib/index.d.ts",
|
|
31
32
|
"main": "lib/nf-double-half-year.cjs.js",
|
|
32
33
|
"module": "lib/nf-double-half-year.esm-bundler.js",
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "8cbd9254da4ec43f46b29198c0839bf2ba19132d"
|
|
34
35
|
}
|
package/lib/util.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function getHalfYear(date?: Date): number;
|
|
2
|
-
export declare function getNextYear(date?: Date): Date;
|
|
3
|
-
export declare function endOf(now: Date | undefined, unit: any): Date;
|
|
4
|
-
export declare function startOf(date: any, unit: any): Date;
|
|
5
|
-
export declare function formatDate(date: any, format: any): any;
|
package/package/util.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export function getHalfYear(date = new Date()) {
|
|
2
|
-
const currMonth = date.getMonth() + 1
|
|
3
|
-
return Math.floor((currMonth % 6 == 0 ? (currMonth / 6) : (currMonth / 6 + 1)))
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export function getNextYear(date = new Date()) {
|
|
7
|
-
return new Date(date.setFullYear(date.getFullYear() + 1))
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function endOf(now = new Date(), unit) {
|
|
11
|
-
if (unit === 'year') {
|
|
12
|
-
return new Date(now.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
13
|
-
}
|
|
14
|
-
if (unit === 'month') {
|
|
15
|
-
return new Date(new Date(now.getFullYear(), now.getMonth() + 1, 1).getTime() - 1);
|
|
16
|
-
}
|
|
17
|
-
if (unit === 'week') {
|
|
18
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()), 23, 59, 59, 999);
|
|
19
|
-
}
|
|
20
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function startOf(date, unit) {
|
|
24
|
-
const newDate = new Date(date)
|
|
25
|
-
if (unit === 'year') {
|
|
26
|
-
newDate.setMonth(0)
|
|
27
|
-
newDate.setDate(1)
|
|
28
|
-
newDate.setHours(0, 0, 0, 0)
|
|
29
|
-
} else if (unit === 'month') {
|
|
30
|
-
newDate.setDate(1)
|
|
31
|
-
newDate.setHours(0, 0, 0, 0)
|
|
32
|
-
} else if (unit === '') {
|
|
33
|
-
newDate.setHours(0, 0, 0, 0)
|
|
34
|
-
} else if (unit === 'hour') {
|
|
35
|
-
newDate.setMinutes(0, 0, 0)
|
|
36
|
-
} else if (unit === 'minute') {
|
|
37
|
-
newDate.setSeconds(0, 0)
|
|
38
|
-
} else if (unit === 'second') {
|
|
39
|
-
newDate.setMilliseconds(0)
|
|
40
|
-
}
|
|
41
|
-
return newDate
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function formatDate(date, format) {
|
|
45
|
-
const year = date.getFullYear()
|
|
46
|
-
const month = date.getMonth() + 1
|
|
47
|
-
const day = date.getDate()
|
|
48
|
-
const hours = date.getHours()
|
|
49
|
-
const minutes = date.getMinutes()
|
|
50
|
-
const seconds = date.getSeconds()
|
|
51
|
-
format = format.replace('YYYY', year)
|
|
52
|
-
format = format.replace('MM', String(month).padStart(2, '0'))
|
|
53
|
-
format = format.replace('DD', String(day).padStart(2, '0'))
|
|
54
|
-
format = format.replace('HH', String(hours).padStart(2, '0'))
|
|
55
|
-
format = format.replace('mm', String(minutes).padStart(2, '0'))
|
|
56
|
-
format = format.replace('ss', String(seconds).padStart(2, '0'))
|
|
57
|
-
return format
|
|
58
|
-
}
|