@farm-investimentos/front-mfe-components 15.4.0 → 15.4.1
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/dist/front-mfe-components.common.js +116 -100
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +116 -100
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/RangeDatePicker/RangeDatePicker.vue +14 -0
package/package.json
CHANGED
|
@@ -152,6 +152,19 @@ export default defineComponent({
|
|
|
152
152
|
this.menuField = false;
|
|
153
153
|
this.$refs.contextmenu.inputValue = false;
|
|
154
154
|
},
|
|
155
|
+
sortDates(dates) {
|
|
156
|
+
if(dates?.length !== 2) {
|
|
157
|
+
return dates;
|
|
158
|
+
}
|
|
159
|
+
const firstDate = new Date(dates[0]);
|
|
160
|
+
const secondDate = new Date(dates[1]);
|
|
161
|
+
|
|
162
|
+
if (firstDate.getTime() < secondDate.getTime()) {
|
|
163
|
+
return [dates[0], dates[1]];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return [dates[1], dates[0]];
|
|
167
|
+
},
|
|
155
168
|
formatDatePickerHeader,
|
|
156
169
|
},
|
|
157
170
|
computed: {
|
|
@@ -160,6 +173,7 @@ export default defineComponent({
|
|
|
160
173
|
return this.value;
|
|
161
174
|
},
|
|
162
175
|
set(val) {
|
|
176
|
+
val = this.sortDates(val);
|
|
163
177
|
this.$emit('input', val);
|
|
164
178
|
},
|
|
165
179
|
},
|