Skip to content

Commit

Permalink
Show isolocal and tzname properties on the popup
Browse files Browse the repository at this point in the history
Closes #108.
  • Loading branch information
linusg committed Feb 26, 2024
1 parent 7398da7 commit 06faa73
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/components/LDeviceLocationPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<li :title="$t('Timestamp')">
<ClockIcon size="1x" aria-hidden="true" role="img" />
{{ new Date(timestamp * 1000).toLocaleString($config.locale) }}
<span v-if="isoLocal && timeZone">
<br />
<code style="font-size: 0.7rem">
{{ isoLocal }}[{{ timeZone }}]
</code>
</span>
</li>
<li :title="$t('Location')">
<MapPinIcon size="1x" aria-hidden="true" role="img" />
Expand Down Expand Up @@ -59,7 +65,6 @@
.wrapper {
display: flex;
margin-top: 10px;
margin-right: 20px;
img {
align-self: start;
Expand Down Expand Up @@ -116,6 +121,14 @@ export default {
type: Number,
default: 0,
},
isoLocal: {
type: String,
default: "",
},
timeZone: {
type: String,
default: "",
},
lat: {
type: Number,
default: 0,
Expand Down
4 changes: 4 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ interface OTLocation {
isorcv?: string;
/** ISO 8601 timestamp */
isotst?: string;
/** ISO 8601 timestamp in local time */
isolocal?: string;
/** tzdb time zone name */
tzname?: string;
/** Latitude in degrees */
lat: number;
/** Longitude in degrees */
Expand Down
6 changes: 5 additions & 1 deletion src/views/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@
:name="l.name"
:face="l.face"
:timestamp="l.tst"
:iso-local="l.isolocal"
:time-zone="l.tzname"
:lat="l.lat"
:lon="l.lon"
:alt="l.alt"
:battery="l.batt"
:speed="l.vel"
:regions="l.inregions"
:wifi="{ ssid: l.SSID, bssid: l.BSSID }"
:options="{ className: 'leaflet-popup--for-pin' }"
:options="{ className: 'leaflet-popup--for-pin', maxWidth: 400 }"
:address="l.addr"
/>
</LMarker>
Expand Down Expand Up @@ -87,6 +89,8 @@
:name="l.name"
:face="l.face"
:timestamp="l.tst"
:iso-local="l.isolocal"
:time-zone="l.tzname"
:lat="l.lat"
:lon="l.lon"
:alt="l.alt"
Expand Down

0 comments on commit 06faa73

Please sign in to comment.