In regards to my custom WordPress PHP code below, I'm looking for a potential solution where I could take the current stored value of the "days" variable, somehow add it to the "content" schema property and eventually print out that date value in date format and in the 24-hour time format. Would that even be possible?
Currently, days[number].hours prints a line of text similar to the line below:
- "10:00 am - 6:00 pm"
The steps I tried so far:
- I tried adding the "{{ days[1].hours }}" code in the
tag with the schema content property included in the
tag but it just prints the code as plain text only.
- I tried adding the "{{ days[1].hours }}" to the tag but that doesn't output anything.
- I tried looking at different WordPress theme files and template files for PHP code that could be helpful to address my issue but I had no luck with that either.
If anyone has any comments or suggestions regarding this issue, please let me know.
P.S. - This custom code came from a previous developer. This isn't my PHP code so please go easy on me :)
$output = springf('
<vuejs-datepicker :value="current_date.toDate()"
input-class="calendar_input"
@selected="setWeek" ref="programaticOpen" <?php echo (ICL_LANGUAGE_CODE
!== 'en' ? '
:language="' . ICL_LANGUAGE_CODE . '"' : '' ); ?>></vuejs-datepicker>
<div class="week_hours">
<div class="day_hours">
<p class="day"><?php _e('Sunday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[1].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Monday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[2].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Tuesday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[3].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Wednesday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[4].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Thursday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[5].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Friday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[6].hours }}</p>
</div>
<div class="day_hours">
<p class="day"><?php _e('Saturday','NP'); ?></p>
<p v-if="days" class="hours">{{ days[7].hours }}</p>
</div>
</div>