Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Fix config id
Browse files Browse the repository at this point in the history
  • Loading branch information
bonustrack committed Jul 23, 2020
1 parent 521c375 commit 75a31ab
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/Modal/SelectDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<UiModal :open="open" @close="$emit('close')">
<form @submit.prevent="handleSubmit" class="modal-body">
<div v-if="step === 0">
<h3 class="m-4 text-center">Select a date</h3>
<h3 class="m-4 text-center">Select {{ selectedDate }} date UTC</h3>
<div class="modal-body m-4">
<UiCalendar v-model="input" class="mx-auto mb-2" />
</div>
</div>
<div v-else>
<h3 class="m-4 mb-0 text-center">Select a time UTC</h3>
<h3 class="m-4 mb-0 text-center">Select {{ selectedDate }} time UTC</h3>
<div class="d-flex m-4 mx-auto" style="max-width: 160px;">
<UiButton class="px-0 width-fit">
<input v-model="form.h" max="24" class="input text-center col-5" />
Expand Down Expand Up @@ -36,7 +36,7 @@

<script>
export default {
props: ['open', 'value'],
props: ['open', 'value', 'selectedDate'],
data() {
return {
input: '',
Expand Down
18 changes: 14 additions & 4 deletions src/components/Ui/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
<div v-for="day in days" :key="day">
<a
class="day border-bottom border-right selectable"
:class="{ selected: input.includes(formatDate(year, month, day)) }"
:class="{
'bg-gray-dark': formatDate(year, month, day) === today,
selected: input.includes(formatDate(year, month, day))
}"
v-if="isSelectable(year, month, day)"
v-text="day"
@click="toggleDay(year, month, day)"
Expand All @@ -49,6 +52,13 @@ export default {
};
},
computed: {
today() {
return this.formatDate(
new Date().getFullYear(),
new Date().getMonth(),
new Date().getDate()
);
},
daysOfWeek() {
const sunday = new Date(2017, 0, 0);
return [...Array(7)].map(() => {
Expand Down Expand Up @@ -76,7 +86,7 @@ export default {
},
methods: {
formatDate(year, month, day) {
return new Date(year, month, day + 1).toISOString().split('T')[0];
return new Date(year, month, day).toISOString().split('T')[0];
},
toggleDay(year, month, day) {
this.input = this.formatDate(year, month, day);
Expand Down Expand Up @@ -125,8 +135,8 @@ export default {
}
&.selected {
background-color: $white;
color: $black;
background-color: $white !important;
color: $black !important;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/views/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
</div>
<ModalSelectDate
:value="form[selectedDate]"
:selectedDate="selectedDate"
:open="modalOpen"
@close="modalOpen = false"
@input="setDate"
Expand Down Expand Up @@ -123,7 +124,7 @@ export default {
: { token: this.key, verified: [] };
},
isValid() {
const ts = (Date.now() / 1e3).toFixed();
// const ts = (Date.now() / 1e3).toFixed();
return (
!this.loading &&
this.web3.account &&
Expand Down

0 comments on commit 75a31ab

Please sign in to comment.