|
17 | 17 | > |
18 | 18 | <section class="d-flex"> |
19 | 19 | <span class="date-display"> |
20 | | - <span class="day">27</span> |
21 | | - <span class="month">Oct</span> |
| 20 | + <span class="day">{{ ev.daySimple }}</span> |
| 21 | + <span class="month">{{ ev.monthSimple }}</span> |
22 | 22 | </span> |
23 | 23 | <div class="ml-4"> |
24 | 24 | <div class="body-1 blue-grey--text mb-1">{{ ev.fullDate }}</div> |
|
50 | 50 |
|
51 | 51 | <script> |
52 | 52 | import moment from 'moment' |
53 | | - import { mapGetters } from 'vuex' |
54 | 53 |
|
55 | 54 | export default { |
56 | 55 | name: 'HomeHeaderMeetup', |
57 | | - data() { |
58 | | - return { |
59 | | - ev: null, |
60 | | - } |
61 | | - }, |
62 | | - computed: { |
63 | | - ...mapGetters( [ 'getMeetupData' ] ), |
64 | | - // fullDate () { |
65 | | - // return this.getMeetupData.length |
66 | | - // } |
| 56 | + props: { |
| 57 | + ev: { |
| 58 | + required: true, |
| 59 | + type: Object, |
| 60 | + }, |
67 | 61 | }, |
68 | 62 | created() { |
69 | 63 | moment.locale( 'es' ) |
70 | | - if ( this.getMeetupData.length > 0 ) { |
71 | | - const format = 'YYYY-MM-DD' |
72 | | - this.ev = this.getMeetupData[ 0 ] |
73 | | - const hour = moment( this.ev.local_time, 'hh:mm' ).format( 'hh' ) |
74 | | - const minutes = moment( this.ev.local_time, 'hh:mm' ).format( 'mm' ) |
75 | | - this.ev.fullDate = moment( this.ev.local_date, format ).hour( hour ).minutes( minutes ).format( 'LLL' ) |
76 | | - } |
| 64 | + const format = 'YYYY-MM-DD' |
| 65 | + const hour = moment( this.ev.local_time, 'hh:mm' ).format( 'hh' ) |
| 66 | + const minutes = moment( this.ev.local_time, 'hh:mm' ).format( 'mm' ) |
| 67 | + this.ev.fullDate = moment( this.ev.local_date, format ).hour( hour ).minutes( minutes ).format( 'LLL' ) |
| 68 | + this.ev.daySimple = moment(this.ev.local_date, format).format('DD') // 02 |
| 69 | + this.ev.monthSimple = moment(this.ev.local_date, format).format('MMM') // dic |
77 | 70 | }, |
78 | 71 | methods: { |
79 | 72 | goToEvent() { |
|
111 | 104 | display block |
112 | 105 | font-weight bolder |
113 | 106 | line-height 1.1 |
| 107 | + .month |
| 108 | + text-transform capitalize |
114 | 109 |
|
115 | 110 | .name |
116 | 111 | position relative |
|
0 commit comments