You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
All: Fix format of geolocation data (#2673)
* Maintain geolocation data format through serialization. * Add test.
This commit is contained in:
@ -257,6 +257,9 @@ class BaseItem extends BaseModel {
|
||||
if (['title_diff', 'body_diff'].indexOf(propName) >= 0) {
|
||||
if (!propValue) return '';
|
||||
propValue = JSON.parse(propValue);
|
||||
} else if (['longitude', 'latitude', 'altitude'].indexOf(propName) >= 0) {
|
||||
const places = (propName === 'altitude') ? 4 : 8;
|
||||
propValue = Number(propValue).toFixed(places);
|
||||
} else {
|
||||
if (['created_time', 'updated_time', 'user_created_time', 'user_updated_time'].indexOf(propName) >= 0) {
|
||||
propValue = (!propValue) ? '0' : moment(propValue, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format('x');
|
||||
|
Reference in New Issue
Block a user