Converting mm/dd/yyyy to dd/mm/yyyy

yuneekguy
yuneekguy Member
edited February 11, 2022 in Analytics #1
I just picked up Birt about a week now and I know my question might seem very basic. But basic has it might sound, if you have an answer, I'd appreciate it. Now the challenge is this; I am using a scripted source (even though I have not completely got my head around what that means), my table dataset has a column entryDate which is a string.I need to convert it from the format mm/dd/yyyy to dd/mm/yyyy. I tried using with the expression builder like so;

var dateToConvert = Date.parse(dataSetRow["entryDate"]);
var convertedDateString = (dateToConvert .toString('dd/mm/yyyy'));

the entire table detail row failed to resolve data afterwards. If you have an idea, pls can you help me out? Its really frustrating.

Comments

  • yuneekguy
    yuneekguy Member
    edited December 31, 1969 #2
    Pls Note that I use Birt 2.3 (Old huh?). I also would like to know how you can add a new currency symbol in birt.
  • mwilliams
    mwilliams Member
    edited December 31, 1969 #3
    If you look in the property editor, when you have a data element from your table selected, you can see options for formatting dates, numbers, and strings. Here you can choose from a default list of formats or create your own custom one. Hope this helps.
    Warning No formatter is installed for the format ipb
  • yuneekguy
    yuneekguy Member
    edited December 31, 1969 #4
    <blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="95540" data-time="1328815807" data-date="09 February 2012 - 12:30 PM"><p>
    If you look in the property editor, when you have a data element from your table selected, you can see options for formatting dates, numbers, and strings. Here you can choose from a default list of formats or create your own custom one. Hope this helps.<br /></p></blockquote>
    <br />
    Thanks mwilliams. I came around it pretty much easily. I've got a new question now; Birt has a few currency symblos, how do you add a new currency symbol that does not exist?
  • CBR
    CBR Member
    edited December 31, 1969 #5
    You have to use a custom format code, if you want to add a new currency symbol that doesn't exist in the dialog.
    therefore choose custom instead of currency. There should be a text field called Format code.
    Enter: ###,##0.00 (this will format your number accordingly) and append your custom currency symbol (as prefix or suffix, with or without a space)
  • yuneekguy
    yuneekguy Member
    edited December 31, 1969 #6
    <blockquote class='ipsBlockquote' data-author="'cbrell'" data-cid="96165" data-time="1329402569" data-date="16 February 2012 - 07:29 AM"><p>
    You have to use a custom format code, if you want to add a new currency symbol that doesn't exist in the dialog.<br />
    therefore choose custom instead of currency. There should be a text field called Format code.<br />
    Enter: ###,##0.00 (this will format your number accordingly) and append your custom currency symbol (as prefix or suffix, with or without a space)<br /></p></blockquote>
    <br />
    Thanks cbrell but the challenge is I use Birt 2.3 and I suppose it doesn't have that Custom option. Is there any way around it with Birt 2.3?
  • mwilliams
    mwilliams Member
    edited December 31, 1969 #7
    The "custom" option is in 2.3, as well. When you select your currency data element in your design and go to the property editor. You'll see an option for number format. Inside that, you'll see a "Format as" drop down. At the bottom of the list box, there is an option for "custom". Select that, then go to the bottom of the property editor window and you'll see the "format code" text box where you will enter your custom code.
    Warning No formatter is installed for the format ipb