Birt - How to format default date parameter as yyyy-MM-dd - reporting

I want my parameter default to be the first day of this year so I put in the formula:
BirtDateTime.firstDayOfYear(BirtDateTime.today())
And I'd like the default to be displayed in yyyy-MM-dd format so the users know what format to enter.
However when I run the preview it shows the default as "Jan 1, 2012".
Here is a screen shot of my parameter settings, and a screen shot of the report:

You can use Formatter which is a birt function
var now = new Date();
Formatter.format(now, "yyyy-MM-dd");
Another answer is here:
http://eclipse.org/birt/documentation/tutorial/tutorial-12.php
basically all you have to do is add a new data field. Make it a DateTime and add new Date( ) as the function. In the properties there is a tab called "Format DateTime". You can choose your format there.
I know there's been struggle with this issue across the web so I wanted to give as much info as possible.

Related

Unspecified error while selecting a date from calendar in UFT

I am new to UFT and automating a desktop application, I am facing challenge while setting a date from calendar picker.
Window("Application").Window("Run Process Group").WinObject("01 / 14 / 2020").Click 442,7
Window("Application").Window("Run Process Group").Window("Window").WinCalendar("SysMonthCal32").SetDate "15-Jan-2020"
In the above lines value inside WinObject("01 / 14 / 2020") changes based on prepopulated date.
Window("Application").Window("Run Process Group").WinObject("01 / 14 / 2020").Click 442,7
This line is clicking on calendar however while executing second line I am getting an error saying unspecified error "Window("Application").Window("Run Process Group").Window("Window").WinCalendar("SysMonthCal32").SetDate "15-Jan-2020""
Please help me out to make this work, my requirement is to click on calendar(but calendar object's values changes based on prepopulated date so need to parameterize this) and select date(date will be passed from an external file)
Look at your date format.
You have DD/MM/YYYY in application and you are setting date "SetDate "15-Jan-2020"". Try set it
Check this link.
Regards
Got the solution, actually I was not selecting all required UFT add ins, my application's window type is swfwindow but since I haven't selected add ins, UFT recorded it as window. after selecting add ins my issue is resolved.

V-model of TimePicker can't be set to any value

Playground example:
https://play.nativescript.org/?template=play-vue&id=dZAlXG&v=10
It's not possible to set a value to v-model, If you log it will say that is that value. But the UI don't change. It's not possible. I also tried to use :hour and :minutes but that is even worse.
Playground example: https://play.nativescript.org/?template=play-vue&id=dZAlXG&v=7
What I want is that when you press the button now that he will change the time to the current time.
Looking at your code, I think it's the issue with the initial value you are setting on selectedTime
this.selectedTime = moment().format("LT");
TimePicker works with Date object, but you are setting the initial value to a string, using a Date helps v-model to function as expected
this.selectedTime = moment().toDate();

Umbraco DateTime Picker Custom Validation

Have noticed that umbraco datepicker property doesn't allow for dates before 1900. Is there someway I can customize the validation to allow for this?
The minDate in the bootstrap date time picker is set to 1900. You can override this by setting the following variable (in this example I'm setting it to 1800):
$.fn.datetimepicker.defaults.minDate = moment({y: 1800});
You COULD change this in the source JS for Umbraco, but you'd lose the change if you updated Umbraco at any point. Your best bet is to add it as a script, and include it in your back offices pages using a package manifest in the app_plugins folder, something like this:
{
"javascript" : [
'~/App_Plugins/YourFolder/yourfile.js'
]
}
Where your file sets the variable.
There is some more information on this issue here: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/69475-date-picker-for-pre-1900-dates

Change format of Telerik DateTimePicker's TimePicker control

Per the instructions here, I have changed the format of my DateTimePicker to use HH for the date format. And yet, the little clock icon to the right of the textbox still displays the choices in terms of AM and PM. Does anyone know if there is a way to force that to use the same time format?
My current code:
#( Html.Telerik().DateTimePicker()
.Name("DateTimePicker")
.Value(DateTime.Now)
.Format("MM/dd/yyyy HH:mm:ss")
.HtmlAttributes(new { #class = "ui-widget" })
)
From what I have been able to test, the AM/PM display relies more on kendo.culture than on the DateTimePicker format.
If I am using the format you provide : ("MM/dd/yyyy HH:mm:ss") with the default culture, I am getting the same display as you get.
But for example if I specify french culture using this simple line :
" kendo.culture('fr') "
and I specify this same format, I get rid of the AM/PM thing. I do not know what is your whole goal, but I hope this helps.

How to open and handle richtext editor in javascript in sitecore 6.5?

I've been working on a custom field, which contains a list.
I have to be able to edit the selected item on the list in a richtext editor. (this is the only missing part).
I've read the topic on opening from c# code Opening Rich Text Editor in custom field of Sitecore Content Editor .
This works nice for the "add" button, since i have to open the RTE empty(with default text...), but not for the Edit button.
My aproaches are:
Somehow in the Edit button's message field list:edit(id=$Target) pass the selected index (like list:edit(id=$Target,index=$SelectedIndex), but i don't know how to populate $SelectedIndex
Somehow in the overridden HandleMessage method get the list's selected index. I'm able to get the selected value Sitecore.Context.ClientPage.ClientRequest.Form[ID of list], but thats alone not much of a help, since i won't be able to decide which one to edit if two listitem equals.
Do the richtext editor opening and handling fully in javascript. As i saw at some script in content editor, i tried to do that, but i can't understand it clearly:
richtext editor url:
var page = "/sitecore/shell/Controls/Rich Text Editor/EditorPage.aspx";
some params :
var params = "?da=core&id&ed=" + id + "&vs=1&la=en&fld=" + id + "&so&di=0&hdl=H14074466&us=sitecore%5cadmin&mo";
and the part where i'm not sure:
var result = scForm.browser.showModalDialog(page + params, new Array(window), "dialogHeight:650px; dialogWidth:900px;");
This way the RTE opens as expected (i guess i could get the selected index from javascript and pass it as a parameter later). However when i click ok, i get exception from EditorPage.js saveRichText function: Cannot read property 'ownerDocument' of null. Am i missing some parameter?
Either of the three aproaches is fine for me(also i'm open for new better ones) as soon as i'm able to do it.
Thanks in advance!
Tamas
I was able to enter some javascript into the message:
list:Edit(id=$Target,index='+document.getElementById(ID of the select using $Target ).selectedIndex+')
this way i got the index in HandleMessage.
I'm waiting for better solutions now.

Resources