Page 1 of 1
How to do Calendar Format
Posted: Tue Apr 27, 2010 9:28 pm
by RickyHuang
Our Calendar is yyyy-1911/MM/dd
exp:
2010/04/30 = 99/04/30
C# format
Convert.ToInt16(DateTime.Now.AddYears(-1911).Year) + DateTime.Now.ToString("/MM/dd");
Can I add a new Customer Format like it?
How to do Calendar Format
Posted: Wed Apr 28, 2010 3:19 am
by Jan
Hello,
You can use following expression in text component:
Code: Select all
{Convert.ToInt16(MyDataSource.Field.AddYears(-1911).Year) + MyDataSource.Field.ToString("/MM/dd");}
Thank you.
How to do Calendar Format
Posted: Wed Apr 28, 2010 4:31 am
by RickyHuang
Thanks,But It's not work
like this
{Convert.ToInt16(Today.AddYears(-1911).Year) + Today.ToString("/MM/dd")}
or
{Convert.ToInt16(Today.AddYears(-1911).Year) + Today.ToString("/MM/dd");}
I finish it use Customer Function,but it looks like not a good idea
Public Shared Function ROCMyDate(ByVal oldDate As Date) As String
Dim MyYear As String = CStr(DateAndTime.Year(oldDate) - 1911)
Dim MyMonth As String = CStr(DateAndTime.Month(oldDate))
Dim MyDay As String = CStr(DateAndTime.Day(oldDate))
If MyMonth.Length = 1 Then MyMonth = "0" & MyMonth
If MyDay.Length = 1 Then MyDay = "0" & MyDay
Return MyYear & "/" & MyMonth & "/" & MyDay
End Function
How to do Calendar Format
Posted: Wed Apr 28, 2010 6:36 am
by Jan
Hello,
Following expression work fine for me:
Code: Select all
{System.Convert.ToInt16(Today.AddYears(-1911).Year) + Today.ToString("/MM/dd")}
Thank you.
How to do Calendar Format
Posted: Wed Apr 28, 2010 11:01 pm
by RickyHuang
Thank you,it works very good ^_^
There're some problems in this instruction.
Dictionary
-->DateSerial(long,long,long): DateTime
on runtime,it needs
-->DateSerial(int,int,int)
How to do Calendar Format
Posted: Thu Apr 29, 2010 1:57 pm
by Jan
Hello,
Problem solved. Changes will be available in next prerelease build.
Thank you.