Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Two Digit Date Format Support
Two Digit Date Format Support [message #368518] Sat, 06 June 2009 14:40 Go to next message
Anirudh Jhina is currently offline Anirudh JhinaFriend
Messages: 12
Registered: July 2009
Junior Member
Hi,

Is there a two digit date format support in BIRT, like we have in windows.
e.g. if the user enters a two digit no. it should be interpreted between
two years.
Say we set the threshold value to be 40 somewhere.
Now if the user enters a value <= 40, the birt should pick the system year
and prefix this no with it.
if the user enters a value >40 then it should use 19 as a prefix. e.g
(1945)

If this is not supported, is there any way we can extend BIRT to provide
this functionality.
Any help would be highly appreciated.

Thanks,
Anirudh
Re: Two Digit Date Format Support [message #368533 is a reply to message #368518] Mon, 08 June 2009 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Anirudh

You should be able to do this with BIRT script. After the user enters
the value where are you using it?
If you were using it in an expression you should be able to do something
like

var myyear = params["EnteredYear"].value
if( myyear > 40 )
//assumes int parm val
myyear = myyear +1900;
}else{
myyear = myyear+2000;
}

You can then use myyear to create a date variable.

Jason

Anirudh wrote:
> Hi,
>
> Is there a two digit date format support in BIRT, like we have in windows.
> e.g. if the user enters a two digit no. it should be interpreted between
> two years. Say we set the threshold value to be 40 somewhere.
> Now if the user enters a value <= 40, the birt should pick the system
> year and prefix this no with it. if the user enters a value >40 then it
> should use 19 as a prefix. e.g (1945)
>
> If this is not supported, is there any way we can extend BIRT to provide
> this functionality.
> Any help would be highly appreciated.
>
> Thanks,
> Anirudh
>
Re: Two Digit Date Format Support [message #368545 is a reply to message #368533] Tue, 09 June 2009 09:32 Go to previous messageGo to next message
Anirudh Jhina is currently offline Anirudh JhinaFriend
Messages: 12
Registered: July 2009
Junior Member
Jason,
Thanks for the reply. I would further like to ask you if there is any way
by which we can extend BIRT to have this set as a setting. (say somewhere
in Prefrences).
Now when we have parameterised reports, with the type of parameter being
date.
Can we somehow apply this logic to convert the two digit year, when the
user enters the date in 'yy' or mm-dd-yy format.

Having this option to set at the Prefrence would ensure that all dates
with year as 'yy' are automatically converted.


Anirudh.
Re: Two Digit Date Format Support [message #368550 is a reply to message #368545] Tue, 09 June 2009 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Anirudh,

I cant think of an easy way to include this without modifying the
source. There is a script extension that allows you to include your own
functions, but I believe the parameter would still have to be a string
to begin with. If you want log an enhancement request to ask for the
feature.

Jason

Anirudh wrote:
> Jason,
> Thanks for the reply. I would further like to ask you if there is any
> way by which we can extend BIRT to have this set as a setting. (say
> somewhere in Prefrences). Now when we have parameterised reports, with
> the type of parameter being date.
> Can we somehow apply this logic to convert the two digit year, when the
> user enters the date in 'yy' or mm-dd-yy format.
>
> Having this option to set at the Prefrence would ensure that all dates
> with year as 'yy' are automatically converted.
>
>
> Anirudh.
>
>
Re: Two Digit Date Format Support [message #368566 is a reply to message #368550] Wed, 10 June 2009 15:08 Go to previous message
Anirudh Jhina is currently offline Anirudh JhinaFriend
Messages: 12
Registered: July 2009
Junior Member
Jason,

Thanks for the help.

Anirudh
Previous Topic:BIRT reports from an applet
Next Topic:Reg. Scripted Data Source ClassPath
Goto Forum:
  


Current Time: Thu Apr 25 06:48:24 GMT 2024

Powered by FUDForum. Page generated in 0.03341 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top