react-bootstrap-front 3.10.0 → 3.10.2
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/package.json
CHANGED
|
@@ -121,7 +121,8 @@ export default class InputDateWeb extends Component {
|
|
|
121
121
|
let dd = '';
|
|
122
122
|
try {
|
|
123
123
|
const [day, month, year] = val.split('/');
|
|
124
|
-
dd = ensureDatetimeTZ(new Date(Number(year), Number(month) - 1, Number(day)));
|
|
124
|
+
dd = ensureDatetimeTZ(new Date(Number(year), Number(month) - 1, Number(day)), false);
|
|
125
|
+
console.log(dd);
|
|
125
126
|
} catch (ex) {
|
|
126
127
|
dd = '';
|
|
127
128
|
}
|
|
@@ -138,7 +139,7 @@ export default class InputDateWeb extends Component {
|
|
|
138
139
|
const event = {
|
|
139
140
|
target: {
|
|
140
141
|
name: this.props.name,
|
|
141
|
-
value: ensureDatetimeTZ(date),
|
|
142
|
+
value: ensureDatetimeTZ(date, false),
|
|
142
143
|
},
|
|
143
144
|
};
|
|
144
145
|
this.props.onChange(event);
|
|
@@ -10,7 +10,7 @@ export const verifyEmail = (email) => {
|
|
|
10
10
|
const tabs = toTest.split('@');
|
|
11
11
|
if (tabs.length === 2) {
|
|
12
12
|
const domain = tabs[1].split('.');
|
|
13
|
-
if (domain.length
|
|
13
|
+
if (domain.length >= 2) {
|
|
14
14
|
return true;
|
|
15
15
|
} else {
|
|
16
16
|
return false;
|
|
@@ -117,12 +117,24 @@ export const beep = (context, freq = 2800, duration = 80, vol = 50) => {
|
|
|
117
117
|
oscillator.stop(context.currentTime + duration * 0.001);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
export const ensureDatetimeTZ = date => {
|
|
120
|
+
export const ensureDatetimeTZ = (date, hour = true) => {
|
|
121
121
|
if (date instanceof Date) {
|
|
122
|
+
if (!hour) {
|
|
123
|
+
const getYear = date.toLocaleString("default", { year: "numeric" });
|
|
124
|
+
const getMonth = date.toLocaleString("default", { month: "2-digit" });
|
|
125
|
+
const getDay = date.toLocaleString("default", { day: "2-digit" });
|
|
126
|
+
return getYear + '-' + getMonth + '-' + getDay;
|
|
127
|
+
}
|
|
122
128
|
return date.toISOString();
|
|
123
129
|
} else {
|
|
124
130
|
try {
|
|
125
131
|
const nDate = new Date(date);
|
|
132
|
+
if (!hour) {
|
|
133
|
+
const getYear1 = nDate.toLocaleString("default", { year: "numeric" });
|
|
134
|
+
const getMonth1 = nDate.toLocaleString("default", { month: "2-digit" });
|
|
135
|
+
const getDay1 = nDate.toLocaleString("default", { day: "2-digit" });
|
|
136
|
+
return getYear1 + '-' + getMonth1 + '-' + getDay1;
|
|
137
|
+
}
|
|
126
138
|
return nDate.toISOString();
|
|
127
139
|
} catch (ex) {}
|
|
128
140
|
}
|