@fy-/fws-vue 1.2.1 → 1.2.3

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.
@@ -30,9 +30,8 @@ const eventBus = useEventBus();
30
30
  const currentDate = new Date();
31
31
  const defaultDate = new Date(
32
32
  currentDate.setFullYear(currentDate.getFullYear() - 18),
33
- )
34
- .toISOString()
35
- .split("T")[0];
33
+ );
34
+
36
35
  const state = reactive({
37
36
  userData: {
38
37
  Username: userData.value?.UserProfile?.Username || "",
@@ -51,8 +50,6 @@ watchEffect(() => {
51
50
  Bio: userData.value?.UserProfile?.Bio || "",
52
51
  Birthdate: userData.value?.UserProfile?.Birthdate
53
52
  ? new Date(userData.value?.UserProfile?.Birthdate.unixms)
54
- .toISOString()
55
- .split("T")[0]
56
53
  : defaultDate,
57
54
  PublicGender: userData.value?.UserProfile?.PublicGender || false,
58
55
  PublicBio: userData.value?.UserProfile?.PublicBio || false,
@@ -84,9 +81,8 @@ const patchUser = async () => {
84
81
  // @ts-ignore
85
82
  data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
86
83
  } catch (e) {
87
- const birtdateAtUnixms = new Date(birtdate).getTime();
88
84
  // @ts-ignore
89
- data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
85
+ data.Birthdate = data.Birthdate.toISOString().split("T")[0];
90
86
  }
91
87
  // @ts-ignore
92
88
  const response = await rest("User/_Profile", "PATCH", data);
@@ -24,9 +24,8 @@ const props = withDefaults(
24
24
  const currentDate = new Date();
25
25
  const defaultDate = new Date(
26
26
  currentDate.setFullYear(currentDate.getFullYear() - 18),
27
- )
28
- .toISOString()
29
- .split("T")[0];
27
+ );
28
+
30
29
  const ageValidator = (value: any) => {
31
30
  const today = new Date();
32
31
  const birthDate = new Date(value);
@@ -52,8 +51,6 @@ watchEffect(() => {
52
51
  Gender: userData.value?.UserProfile?.Gender || "",
53
52
  Birthdate: userData.value?.UserProfile?.Birthdate
54
53
  ? new Date(userData.value?.UserProfile?.Birthdate.unixms)
55
- .toISOString()
56
- .split("T")[0]
57
54
  : defaultDate,
58
55
  AcceptedTerms: userData.value?.AcceptedTerms || true,
59
56
  };
@@ -93,9 +90,8 @@ const patchUser = async () => {
93
90
  // @ts-ignore
94
91
  data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
95
92
  } catch (e) {
96
- const birtdateAtUnixms = new Date(birtdate).getTime();
97
93
  // @ts-ignore
98
- data.Birthdate = new Date(birtdateAtUnixms).toISOString().split("T")[0];
94
+ data.Birthdate = data.Birthdate.toISOString().split("T")[0];
99
95
  }
100
96
  const response = await rest("User/_ForceProfile", "PATCH", data);
101
97
  if (response && response.result == "success") {
@@ -76,9 +76,7 @@ const handleFocus = () => {
76
76
  const handleBlur = () => {
77
77
  emit("blur", props.id);
78
78
  };
79
- const setDate = (date: string) => {
80
- model.value = new Date(date).toISOString().split("T")[0];
81
- };
79
+
82
80
  const emit = defineEmits([
83
81
  "update:modelValue",
84
82
  "update:checkboxValue",
@@ -187,9 +185,7 @@ defineExpose({ focus, blur, getInputRef });
187
185
  </svg>
188
186
  </div>
189
187
  <VueDatePicker
190
- :model-value="model"
191
- @update:model-value="setDate"
192
- model-type="yyyy-mm-dd"
188
+ v-model="model"
193
189
  auto-apply
194
190
  :placeholder="placeholder"
195
191
  year-first
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "1.2.01",
3
+ "version": "1.2.3",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {