forked from jsnbuchanan/crowd-funder-for-time-pwa
add choice of a start date for a project
This commit is contained in:
@@ -53,9 +53,9 @@
|
||||
<span v-show="showDidCopy">Copied DID</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="timeSince">
|
||||
<div v-if="startTime">
|
||||
<fa icon="calendar" class="fa-fw text-slate-400"></fa>
|
||||
{{ timeSince }}
|
||||
{{ startTime }}
|
||||
</div>
|
||||
<div v-if="latitude || longitude">
|
||||
<fa icon="location-dot" class="fa-fw text-slate-400"></fa>
|
||||
@@ -339,7 +339,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { AxiosError, RawAxiosRequestHeaders } from "axios";
|
||||
import * as moment from "moment";
|
||||
import { IIdentifier } from "@veramo/core";
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
|
||||
@@ -396,7 +395,7 @@ export default class ProjectViewView extends Vue {
|
||||
offersToThis: Array<OfferSummaryRecord> = [];
|
||||
projectId = localStorage.getItem("projectId") || ""; // handle ID
|
||||
showDidCopy = false;
|
||||
timeSince = "";
|
||||
startTime = "";
|
||||
truncatedDesc = "";
|
||||
truncateLength = 40;
|
||||
url = "";
|
||||
@@ -468,11 +467,13 @@ export default class ProjectViewView extends Vue {
|
||||
try {
|
||||
const resp = await this.axios.get(url, { headers });
|
||||
if (resp.status === 200) {
|
||||
const startTime = resp.data.startTime;
|
||||
const startTime = resp.data.claim?.startTime;
|
||||
if (startTime != null) {
|
||||
const eventDate = new Date(startTime);
|
||||
const now = moment.now();
|
||||
this.timeSince = moment.utc(now).to(eventDate);
|
||||
const startDateTime = new Date(startTime);
|
||||
this.startTime =
|
||||
startDateTime.toLocaleDateString() +
|
||||
" " +
|
||||
startDateTime.toLocaleTimeString();
|
||||
}
|
||||
this.agentDid = resp.data.claim?.agent?.identifier;
|
||||
this.issuer = resp.data.issuer;
|
||||
|
||||
Reference in New Issue
Block a user