未验证 提交 ce807324 编写于 作者: J Jeff Wang 提交者: GitHub

Update time format and change the slider theme (#343)

* Format image date string.
Format image slider.

* Fix the incorrect date parse.
上级 35ecf344
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
</h3> </h3>
<p> <p>
<span>Step:</span> <span>Step:</span>
<span>{{imgData.step}};</span> <span>{{imgData.step}}</span>
<span>{{imgData.wall_time | formatTime}}</span> <span class="visual-del-image-time">{{imgData.wall_time | formatTime}}</span>
</p> </p>
<v-slider label="step" <v-slider :max="steps"
:max="steps"
:min="slider.min" :min="slider.min"
:step="1" :step="1"
v-model="currentIndex" v-model="currentIndex"
dark></v-slider> ></v-slider>
<img :width="imageWidth" :height="imageHeight" :src="imgData.imgSrc" /> <img :width="imageWidth" :height="imageHeight" :src="imgData.imgSrc" />
</v-card> </v-card>
...@@ -45,9 +44,13 @@ export default { ...@@ -45,9 +44,13 @@ export default {
if (!value) { if (!value) {
return; return;
} }
let time = new Date(); // The value was made in seconds, must convert it to milliseconds
time.setTime(value.toString().split('.')[0]); let time = new Date(value * 1000);
return time; var options = {
weekday: "short", year: "numeric", month: "short",
day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit"
};
return time.toLocaleDateString("en-US", options);
} }
}, },
data() { data() {
...@@ -154,5 +157,7 @@ export default { ...@@ -154,5 +157,7 @@ export default {
.sm-form-item .sm-form-item
width 300px width 300px
display inline-block display inline-block
.visual-del-image-time
float right
</style> </style>
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
</h3> </h3>
<p> <p>
<span>Step:</span> <span>Step:</span>
<span>{{textData.step}};</span> <span>{{textData.step}}</span>
<span>{{textData.wall_time | formatTime}}</span> <span class="visual-del-text-time">{{textData.wall_time | formatTime}}</span>
</p> </p>
<v-slider label="step" <v-slider :max="steps"
:max="steps"
:min="slider.min" :min="slider.min"
:step="1" :step="1"
v-model="currentIndex" v-model="currentIndex"
dark></v-slider> ></v-slider>
<p> {{textData.message}} </p> <p> {{textData.message}} </p>
</v-card> </v-card>
...@@ -38,9 +37,13 @@ export default { ...@@ -38,9 +37,13 @@ export default {
if (!value) { if (!value) {
return; return;
} }
let time = new Date(); // The value was made in seconds, must convert it to milliseconds
time.setTime(value.toString().split('.')[0]); let time = new Date(value * 1000);
return time; var options = {
weekday: "short", year: "numeric", month: "short",
day: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit",
};
return time.toLocaleDateString("en-US", options);
} }
}, },
data() { data() {
...@@ -142,5 +145,7 @@ export default { ...@@ -142,5 +145,7 @@ export default {
.sm-form-item .sm-form-item
width 300px width 300px
display inline-block display inline-block
.visual-del-text-time
float right
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册