基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
/******************************
|
||||
* 说明:格式化日期类
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2017-07-24
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace Lskj.Control.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 格式化日期类
|
||||
/// </summary>
|
||||
public static class DateFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// 空日期
|
||||
/// </summary>
|
||||
private const string mEmpty = " ";
|
||||
/// <summary>
|
||||
/// 年-月-日
|
||||
/// </summary>
|
||||
private const string mDate = "yyyy-MM-dd";
|
||||
/// <summary>
|
||||
/// 年-月-日 时:分
|
||||
/// </summary>
|
||||
private const string mDateTimeShort = "yyyy-MM-dd HH:mm";
|
||||
/// <summary>
|
||||
/// 年-月-日 时:分:秒
|
||||
/// </summary>
|
||||
private const string mDateTime = "yyyy-MM-dd HH:mm:ss";
|
||||
/// <summary>
|
||||
/// 时:分:秒
|
||||
/// </summary>
|
||||
private const string mTime = "HH:mm:ss";
|
||||
/// <summary>
|
||||
/// 时:分
|
||||
/// </summary>
|
||||
private const string mShortTime = "HH:mm";
|
||||
/// <summary>
|
||||
/// 年-月
|
||||
/// </summary>
|
||||
private const string mShortDate = "yyyy-MM";
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-07-24 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="typeId">ControlType 类型</param>
|
||||
/// <returns>格式化</returns>
|
||||
public static string Format(int typeId)
|
||||
{
|
||||
string formatValue = string.Empty;
|
||||
switch (typeId)
|
||||
{
|
||||
|
||||
default:
|
||||
case (int)ControlType.LabDate:
|
||||
case (int)ControlType.LabCheckDateEx:
|
||||
formatValue = mDate;
|
||||
break;
|
||||
case (int)ControlType.LabDateTime:
|
||||
case (int)ControlType.LabCheckDateTimeEx:
|
||||
formatValue = mDateTime;
|
||||
break;
|
||||
case (int)ControlType.LabDateTimeShort:
|
||||
case (int)ControlType.LabCheckDateTimeShort:
|
||||
formatValue = mDateTimeShort;
|
||||
break;
|
||||
case (int)ControlType.LabTime:
|
||||
case (int)ControlType.LabCheckTime:
|
||||
formatValue = mTime;
|
||||
break;
|
||||
case (int)ControlType.LabShortTime:
|
||||
case (int)ControlType.LabCheckShortTime:
|
||||
formatValue = mShortTime;
|
||||
break;
|
||||
case (int)ControlType.LabShortDate:
|
||||
formatValue = mShortDate;
|
||||
break;
|
||||
}
|
||||
return formatValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user