javascript 显示中之日期range.liquid

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 显示中之日期range.liquid相关的知识,希望对你有一定的参考价值。

{% assign sorted = List.Items | OrderBy: 'FieldValues.DisplayOrder', 'asc' %}

<div class="featured-event-wrapper">
	<ul class="owl-carousel owl-theme">
	
	{% for Item in sorted %}
	    {% assign nowFormatted = 'now' | DateFormat:"uuuu'-'MM'-'dd'T'HH':'mm':'ss", Item.FieldValues.Timezone %}
	    {% assign startFormatted = Item.FieldValues.DisplayStartDate | DateFormat:"uuuu'-'MM'-'dd'T'HH':'mm':'ss", Item.FieldValues.Timezone %}
	    {% assign endFormatted = Item.FieldValues.DisplayEndDate | DateFormat:"uuuu'-'MM'-'dd'T'HH':'mm':'ss", Item.FieldValues.Timezone %}
	    {% if startFormatted < nowFormatted and endFormatted > nowFormatted %}
		<li class="featured-event-item">
			<a href="{{ Item.FieldValues.EventLink }}" class="featured-event-link">
				{% if Item.FieldValues.EventImage != "" %}
                    <img src="{{ Item.FieldValues.EventImage }}" class="featured-event-image" alt="" />
                {% else %}
                    <img src="https://www.speakcdn.com/sitefiles/global/images/svg/placeholder.svg" class="featured-event-image-placeholder" alt="" />
                {% endif %}
			</a>
			<div class="featured-event-DateTime">
    			<p class="featured-event-date">			                
                    {{ Item.FieldValues.EventDate }}
                    
                </p>
                <p class="featured-event-time">
                    <span>{{ Item.FieldValues.EventTime }}</span> 
                    
                </p>
            </div>
            <p class="featured-event-name">
                <a href='{{ Item.FieldValues.EventLink }}'>
                    {{ Item.FieldValues.EventTitle }}
                </a>
            </p>
            <span class="featured-event-description">{{ Item.FieldValues.EventDescription | StripHtml | Truncate: 150 }}</span>
        </li>
         {% endif %}
        {% endfor %}
    </ul>
</div>
	jQ171(document).ready(function($) {
		$('.featured-event-wrapper ul').owlCarousel({
			items: 3,
			autoPlay: true,
			stopOnHover: true,
			navigation: false,
			pagination: true,
			goToFirstSpeed: 1000,
			margin: 20,
			autoHeight: true,
			touchDrag: true,
			itemsTablet: [991, 2],
			itemsMobile: [500, 1]
		});
	});

以上是关于javascript 显示中之日期range.liquid的主要内容,如果未能解决你的问题,请参考以下文章

通过 JavaScript 显示日期 [重复]

请问javascript的日期问题?

JavaScript的日期对象显示当前日期和时间

JavaScript:字符串+日期对象+行走的方块+汉字显示当前日期+秒表的制作

使用 JavaScript 函数显示今天的约会/日期

Javascript:操纵状态栏以显示日期?