-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@using NewLife; | ||
@{ | ||
var fmt = Model as String; | ||
var formatStr = !fmt.IsNullOrEmpty() ? fmt : "yyyy-MM-dd"; | ||
var p = ViewBag.Page as Pager; | ||
|
||
var dataStart = p["dataStart"].ToDateTime(); | ||
var dataEnd = p["dataEnd"].ToDateTime(); | ||
var step = (Int32)(dataEnd - dataStart).TotalDays + 1; | ||
} | ||
<div class="form-group"> | ||
<label for="dataStart" class="control-label">数据时间:</label> | ||
<div class="input-group"> | ||
@if (formatStr == "yyyy-MM-dd" && (dataStart.Year > 2000 || dataEnd.Year > 2000)) | ||
{ | ||
var url = p.GetBaseUrl(true, true, true, new[] { "dataStart", "dataEnd" }); | ||
if (dataStart.Year > 2000 && dataEnd.Year > 2000) url.UrlParam("dataStart", dataStart.AddDays(-step).ToString("yyyy-MM-dd")); | ||
if (dataStart.Year > 2000 && dataEnd.Year > 2000) url.UrlParam("dataEnd", dataEnd.AddDays(-step).ToString("yyyy-MM-dd")); | ||
<span class="input-group-addon"><a href="[email protected](url)" title="前一段"><i class="fa fa-calendar"></i></a></span> | ||
} | ||
else | ||
{ | ||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> | ||
} | ||
<input name="dataStart" id="dataStart" value="@p["dataStart"]" dateformat="@formatStr" class="form-control form_datetime" autocomplete="off" /> | ||
</div> | ||
@if (formatStr == "yyyy-MM-dd" && (dataStart.Year > 2000 || dataEnd.Year > 2000)) | ||
{ | ||
var url = p.GetBaseUrl(true, true, true, new[] { "dataStart", "dataEnd" }); | ||
if (dataStart.Year > 2000 && dataEnd.Year > 2000) url.UrlParam("dataStart", dataStart.AddDays(step).ToString("yyyy-MM-dd")); | ||
if (dataStart.Year > 2000 && dataEnd.Year > 2000) url.UrlParam("dataEnd", dataEnd.AddDays(step).ToString("yyyy-MM-dd")); | ||
<label for="dataEnd" class="control-label"><a href="[email protected](url)" title="后一段">~</a></label> | ||
} | ||
else | ||
{ | ||
<label for="dataEnd" class="control-label">~</label> | ||
} | ||
<div class="input-group"> | ||
@*<span class="input-group-addon"><i class="fa fa-calendar"></i></span>*@ | ||
<input name="dataEnd" id="dataEnd" value="@p["dataEnd"]" dateformat="@formatStr" class="form-control form_datetime" autocomplete="off" /> | ||
</div> | ||
</div> |