我有一个日期选择器,允许用户选择日期。datepicker代码如下:
<form id="formBean" th:action="@{/dailyStatistics}" th:object=${dataFormBean} >
<!--<h1 class="card-title m-0" >Select Range Date </h1>-->Select Range Date
<button type="button" class="btn btn-primary btn-sm daterange" title="Date range">
<i class="far fa-calendar-alt"></i>
</button>
From: <input type="text" readonly="readonly" id="selectSdateInput" th:field="*{selectSDate}" >
To: <input type="text" readonly="readonly" id="selectEdateInput" th:field="*{selectEDate}" >
</form>
我有两个thymeleaf片段:1.fragments/dailyStatisticsFragments::dailyStatisticsFragmentsToday代码:
<div id="fragments-container" th:replace="fragments/dailyStatisticsFragments :: dailyStatisticsFragmentsToday"></div>
2.fragments/dailyStatisticsFragments::dailyStatisticsFragmentsAll代码:
<div id="fragments-container" th:replace="fragments/dailyStatisticsFragments :: dailyStatisticsFragmentsAll"></div>
我想实现一个?B:c概念,用于百里香叶中的以下要求:如果用户不选择任何日期。系统必须选择
fragments/dailyStatisticsFragments :: dailyStatisticsFragmentsToday
否则,如果用户正在挑选任何日期。系统必须选择
fragments/dailyStatisticsFragments :: dailyStatisticsFragmentsAll
1条答案
按热度按时间sdnqo3pr1#
好吧,我可以通过使用这个synatx解决上面的问题。