mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 10:20:10 +00:00
增加Chart的useUtc参数设置显示时间是否用UTC时间
This commit is contained in:
@@ -485,10 +485,10 @@ namespace XCharts.Runtime
|
||||
|
||||
private static bool isDateFormatter = false;
|
||||
private static string newFormatter = null;
|
||||
public string GetFormatterDateTime(int labelIndex, int totalIndex, double value, double minValue, double maxValue)
|
||||
public string GetFormatterDateTime(int labelIndex, int totalIndex, double value, double minValue, double maxValue, bool local)
|
||||
{
|
||||
var timestamp = value;
|
||||
var dateTime = DateTimeUtil.GetDateTime(timestamp);
|
||||
var dateTime = DateTimeUtil.GetDateTime(timestamp, local);
|
||||
var dateString = string.Empty;
|
||||
if (string.IsNullOrEmpty(numericFormatter) || numericFormatter.Equals("f2"))
|
||||
{
|
||||
@@ -501,7 +501,7 @@ namespace XCharts.Runtime
|
||||
if (DateTimeUtil.IsDateOrTimeRegex(numericFormatter, ref isDateFormatter, ref newFormatter))
|
||||
{
|
||||
if (isDateFormatter)
|
||||
dateString = ChartCached.NumberToDateStr(timestamp, newFormatter);
|
||||
dateString = ChartCached.NumberToDateStr(timestamp, newFormatter, local);
|
||||
else
|
||||
dateString = ChartCached.NumberToTimeStr(timestamp, newFormatter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user