@panoramax/web-viewer 3.2.3-develop-7e5ca4d2 → 3.2.3-develop-efc61aeb

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.3-develop-7e5ca4d2",
3
+ "version": "3.2.3-develop-efc61aeb",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
@@ -127,8 +127,18 @@ export default class PictureMetadata extends LitElement {
127
127
  this._meta?.caption?.date && {
128
128
  title: this._parent?._t.pnx.metadata_general_date,
129
129
  content: html`
130
- <strong>${new Intl.DateTimeFormat(undefined, {dateStyle: "short"}).format(this._meta.caption.date)}</strong>
131
- <br />${new Intl.DateTimeFormat(undefined, {hour: "numeric", minute: "numeric", second: "numeric", fractionalSecondDigits: 3, timeZoneName: "longOffset"}).format(this._meta.caption.date)}
130
+ <strong>${new Intl.DateTimeFormat(undefined, {
131
+ timeZone: this._meta.caption.tz,
132
+ dateStyle: "short"
133
+ }).format(this._meta.caption.date)}</strong>
134
+ <br />${new Intl.DateTimeFormat(undefined, {
135
+ timeZone: this._meta.caption.tz,
136
+ hour: "numeric",
137
+ minute: "numeric",
138
+ second: "numeric",
139
+ fractionalSecondDigits: 3,
140
+ timeZoneName: "longOffset"
141
+ }).format(this._meta.caption.date)}
132
142
  `
133
143
  }
134
144
  ];
@@ -216,8 +226,8 @@ export default class PictureMetadata extends LitElement {
216
226
  this._meta?.caption?.date && {
217
227
  title: this._parent?._t.pnx.metadata_general_date,
218
228
  content: html`
219
- <strong>${new Intl.DateTimeFormat(undefined, {dateStyle: "long"}).format(this._meta.caption.date)}</strong>
220
- <br />${new Intl.DateTimeFormat(undefined, {hour: "numeric",minute:"numeric"}).format(this._meta.caption.date)}
229
+ <strong>${new Intl.DateTimeFormat(undefined, {timeZone: this._meta.caption.tz, dateStyle: "long"}).format(this._meta.caption.date)}</strong>
230
+ <br />${new Intl.DateTimeFormat(undefined, {timeZone: this._meta.caption.tz, hour: "numeric",minute:"numeric"}).format(this._meta.caption.date)}
221
231
  `
222
232
  },
223
233
  // Camera
@@ -235,6 +235,14 @@ export function getNodeCaption(metadata, t) {
235
235
  // Timestamp
236
236
  if(metadata?.properties?.datetimetz) {
237
237
  caption.date = new Date(metadata.properties.datetimetz);
238
+ const timeZoneMatch = metadata.properties.datetimetz.match(/([+-]\d{2}):(\d{2})$|Z$/);
239
+ if (timeZoneMatch) {
240
+ if (timeZoneMatch[0] === "Z") {
241
+ caption.tz = "UTC";
242
+ } else {
243
+ caption.tz = timeZoneMatch[0];
244
+ }
245
+ }
238
246
  }
239
247
  else if(metadata?.properties?.datetime) {
240
248
  caption.date = new Date(metadata.properties.datetime);
@@ -8,6 +8,7 @@ Object {
8
8
  "producer": Array [
9
9
  "Hopen111",
10
10
  ],
11
+ "tz": "+00:00",
11
12
  },
12
13
  "gps": Array [
13
14
  -92.70188245,
@@ -297,6 +298,7 @@ Object {
297
298
  "date": Object {
298
299
  "toLocaleDateString": [Function],
299
300
  },
301
+ "tz": "-03:00",
300
302
  }
301
303
  `;
302
304