Source View more articles and date fix

This commit is contained in:
2020-08-21 02:33:35 +05:00
parent be04822ce3
commit 660eda24cf
15 changed files with 251 additions and 94 deletions

View File

@@ -43,14 +43,12 @@
<div
class="text-gray-600 text-md mt-1 flex justify-end items-center"
>
<p
class="text-gray-600 text-sm text-right mb-2"
class="text-gray-600 text-sm text-right mb-2 MvTyper"
style="direction:rtl;"
>
{{
subarticle.published_date
| moment("calendar")
subarticle.published_date | dhivehiDate
}}
</p>
</div>
@@ -74,18 +72,14 @@
class="mb-4 lg:mb-0 p-4 lg:p-0 w-full md:w-4/7 relative rounded block"
v-if="article"
>
<a
:href="'/article/' + article.id"
>
<a :href="'/article/' + article.id">
<img
:src="article.featured_image"
class="rounded-md object-cover w-full h-3/4"
/>
</a>
<a
:href="'/article/' + article.id"
>
<a :href="'/article/' + article.id">
<h1
class="text-gray-800 text-xl xl:text-md lg:text-md font-bold mt-2 mb-2 leading-9 hover:underline text-right MvTyper"
style="direction:rtl;"
@@ -110,8 +104,11 @@
<div
class="text-gray-600 text-md mt-4 flex justify-end items-center mb-3"
>
<p class="ml-1 text-gray-600 text-right">
{{ article.published_date | moment("calendar") }}
<p
class="ml-1 text-gray-600 text-right MvTyper"
style="direction:rtl;"
>
{{ article.published_date | dhivehiDate }}
</p>
</div>
</div>
@@ -121,6 +118,8 @@
</template>
<script>
import * as moment from "moment";
export default {
name: "todays-pick",
data() {
@@ -130,6 +129,14 @@ export default {
};
},
filters: {
dhivehiDate: function(date) {
if (!date) return "";
moment.locale("dv");
return moment(date).format("Do MMMM YYYY h:mm");
}
},
mounted() {
axios
.get("api/today")