Commit 1d3e86e1 authored by lshan's avatar lshan

safari时间选择

parent 3fbafc18
...@@ -20,8 +20,6 @@ export function transfterStrToDate(str: string) { ...@@ -20,8 +20,6 @@ export function transfterStrToDate(str: string) {
end = `${d.getFullYear()} ${d.getMonth() + 1} ${d.getDate()} ${end}` end = `${d.getFullYear()} ${d.getMonth() + 1} ${d.getDate()} ${end}`
const startDate = new Date(start) const startDate = new Date(start)
const endDate = new Date(end) const endDate = new Date(end)
console.log(start,'start');
return [startDate, endDate] return [startDate, endDate]
} else { } else {
return undefined return undefined
...@@ -39,8 +37,6 @@ export function transfterStrToDateSafari(str: string) { ...@@ -39,8 +37,6 @@ export function transfterStrToDateSafari(str: string) {
end = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${end}` end = `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()} ${end}`
const startDate = new Date(start) const startDate = new Date(start)
const endDate = new Date(end) const endDate = new Date(end)
console.log(start,'start');
console.log(end,'end');
return [startDate, endDate] return [startDate, endDate]
} else { } else {
return undefined return undefined
......
...@@ -784,32 +784,10 @@ export default Vue.extend({ ...@@ -784,32 +784,10 @@ export default Vue.extend({
// const arr2 = transfterStrToDate(record.opening_hours); // const arr2 = transfterStrToDate(record.opening_hours);
const arr2 = transfterStrToDateSafari(record.opening_hours); const arr2 = transfterStrToDateSafari(record.opening_hours);
console.log(transfterStrToDate(record.opening_hours),'transfterStrToDate');
console.log(arr2,'arr2');
if (arr2?.length === 2) { if (arr2?.length === 2) {
const [startDate, endDate] = arr2; const [startDate, endDate] = arr2;
// this.formData.startTime = moment("00:00", "HH:mm"); this.formData.startTime = moment(startDate, "HH:mm");
// this.formData.endTime = moment("22:00", "HH:mm"); this.formData.endTime = moment(endDate, "HH:mm");
const starh=startDate.getHours()<10? '0'+startDate.getHours():startDate.getHours()+''
const starm=startDate.getMinutes()<10? '0'+startDate.getMinutes():startDate.getMinutes()+''
const endh=endDate.getHours()<10? '0'+endDate.getHours():endDate.getHours()+''
const endm=endDate.getMinutes()<10? '0'+endDate.getMinutes():endDate.getMinutes()+''
const start=starh+':'+starm
const end=endh+':'+endm
this.formData.startTime = moment(start,"HH:mm")
this.formData.endTime = moment(end,"HH:mm")
console.log(typeof start,'start');
console.log(end,'end');
const riqi=moment(startDate,"HH:mm")
console.log(riqi,'riqi');
console.log(startDate,'startDate');
console.log(starh,'starh');
console.log(arr2,'arr2');
console.log(arr2[0],'0');
} }
const ret = await AddressService.getInstance().note(record.id); const ret = await AddressService.getInstance().note(record.id);
if (ret.code === 200) { if (ret.code === 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment