Change format of Telerik DateTimePicker's TimePicker control - telerik

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.

Related

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();

customizing sort label of responsive p:dataTable [duplicate]

How can I change the language for Sorting on PF DataTable component with reflow = "true" (so responsive Datatable)?
The problem is that on mobile screen, we can sort data from auto-generated dropdown where we have our sort options, see picture bellow. How can I change the language for this dropdown?
I'm using PF 6.0.
The intended way to do this is to define the following properties in your resource files (see Messages.properties)
primefaces.datatable.SORT_LABEL = Sort
primefaces.datatable.SORT_ASC = Ascending
primefaces.datatable.SORT_DESC = Descending
You can see this when you look at the DatatableRender of primefaces.
Notice i18n is done in different ways in primefaces. Some components like calendar or schedule must be translated via javascript. See here
I never ran into this or used it, but I know the source is open. So I went to the javascript file for the datatable. There I searched for 'Ascending' and via this.ascMessage, I ended up on line 170 where 'datatable.sort.ASC' is used as a key.
This in turn points to line 619 in core.js
getAriaLabel: function(key) {
var ariaLocaleSettings = this.getLocaleSettings()['aria'];
return (ariaLocaleSettings&&ariaLocaleSettings[key]) ? ariaLocaleSettings[key] : PrimeFaces.locales['en_US']['aria'][key];
},
Where you can see the normal PrimeFaces locale functionality is used.
So using your own locale and overriding this part in it, like in the default locale
aria: {
'paginator.PAGE': 'Page {0}',
'calendar.BUTTON': 'Show Calendar',
'datatable.sort.ASC': 'activate to sort column ascending',
'datatable.sort.DESC': 'activate to sort column descending',
'columntoggler.CLOSE': 'Close'
}
Will solve your issue I would expect

p:datatable sort language with responsive reflow = "true"

How can I change the language for Sorting on PF DataTable component with reflow = "true" (so responsive Datatable)?
The problem is that on mobile screen, we can sort data from auto-generated dropdown where we have our sort options, see picture bellow. How can I change the language for this dropdown?
I'm using PF 6.0.
The intended way to do this is to define the following properties in your resource files (see Messages.properties)
primefaces.datatable.SORT_LABEL = Sort
primefaces.datatable.SORT_ASC = Ascending
primefaces.datatable.SORT_DESC = Descending
You can see this when you look at the DatatableRender of primefaces.
Notice i18n is done in different ways in primefaces. Some components like calendar or schedule must be translated via javascript. See here
I never ran into this or used it, but I know the source is open. So I went to the javascript file for the datatable. There I searched for 'Ascending' and via this.ascMessage, I ended up on line 170 where 'datatable.sort.ASC' is used as a key.
This in turn points to line 619 in core.js
getAriaLabel: function(key) {
var ariaLocaleSettings = this.getLocaleSettings()['aria'];
return (ariaLocaleSettings&&ariaLocaleSettings[key]) ? ariaLocaleSettings[key] : PrimeFaces.locales['en_US']['aria'][key];
},
Where you can see the normal PrimeFaces locale functionality is used.
So using your own locale and overriding this part in it, like in the default locale
aria: {
'paginator.PAGE': 'Page {0}',
'calendar.BUTTON': 'Show Calendar',
'datatable.sort.ASC': 'activate to sort column ascending',
'datatable.sort.DESC': 'activate to sort column descending',
'columntoggler.CLOSE': 'Close'
}
Will solve your issue I would expect

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

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.

How to get the Time format for all the regionals

In Control Panel-> Regional and language options-> Regional Options-> Standard and formats, there is the list of all the regionals and by clicking the "Customize" button, the user can set the time format
My question is how to get the current and default time format for all the regionals programmelly?
You can list them through C# like this.
foreach(var cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
Console.WriteLine("{0}: {1}",
cultureInfo.Name,
cultureInfo.IsNeutralCulture ? "-" : cultureInfo.DateTimeFormat.ShortDatePattern);
}

Resources