EditDate: fix division by zero (#56)
parent
272c1a65ea
commit
34a6818242
|
@ -300,7 +300,8 @@ export default class EditDate extends Mixins(GlobalMixin) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const offset = date.getTime() - pDate.getTime();
|
const offset = date.getTime() - pDate.getTime();
|
||||||
const pDateNew = new Date(dateNew.getTime() - offset * (diffNew / diff));
|
const scale = diff > 0 ? (diffNew / diff) : 0;
|
||||||
|
const pDateNew = new Date(dateNew.getTime() - offset * scale);
|
||||||
const res = await axios.patch<any>(generateUrl(EDIT_API_URL, { id: p.fileid }), {
|
const res = await axios.patch<any>(generateUrl(EDIT_API_URL, { id: p.fileid }), {
|
||||||
date: this.getExifFormat(pDateNew),
|
date: this.getExifFormat(pDateNew),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue