Datetimepicker set value of different format - kendo-ui

i want to set the kendo ui DateTimePicker to value with : "dd/MM/yyyy hh:mm:ss"
(notice the order of dd & MM).
when i create the datetimepicker the firmat is :"dd/MM/yyyy hh:mm:ss"
and the value is new Date(xxxx)
when xxxx is "23/11/2013 09:15:30" nothing is presented in the picker
but when xxx is "11/23/2013 09:15:30" this date is presented.
how can i make it use 'dd/MM/yyyy hh:mm:ss' set format
thanks O.

add both formats as parseFormat
$("#datetimepicker").kendoDateTimePicker({
format: "yyyy/MM/dd hh:mm tt",
parseFormats: ["MMMM yyyy", "HH:mm"] //format also will be added to parseFormats
});

Related

How to format date string with date-fns without timezone transformation?

I have really simple date as string as ISO const mytDate = '2021-10-24T16:00:00.000Z' and I want to format it like format(new Date(myDate), 'yyyy-MM-dd HH:mm:ss') but new Date() cause that it convert it to my local timezone and I do not want it. I would like to take this string date and just format it as it is.
Is there a solution ?
Cheers!

Facing issue with Date column format in Power BI

I have an excel dateset where date column includes date in dd-mm-yyyy format(Proper date) and in text format that too in mm/dd/yyyy format(just text not proper date). want to convert all dates in dd-mm-yyyy format. How to do all in dd-mm-yyyy format in Power Query editor
The question is: In Power Query Editor Perform all necessary action to convert all the dates in the "Date" column to be in "dd-mm-yyyy" format.
I am new in Power BI. Please help on this.
enter image description here
Importing correctly
If you set the right culture, all the inputs are converted to a type date
let
Source = #table(
type table[Date = text],
{ {"7/27/2012"}, {"9/14/2020"}, {"04-11-2020"} }
),
// using the system's current culture
#"Dates" = Table.TransformColumnTypes(
Source,
{ {"Date", type date} }
),
//specify a specific culture
#"US Dates" = Table.TransformColumnTypes(
Source,
{ {"Date", type date} },
"en-US"
)
in
#"US Dates"
date verses text
I'm not clear if you're referring to different date format strings, or actual data types when you say Proper Date, I think you mean the first.
In the query editor where you import dates, it should be type date
If it visually displays out of order, that's okay. It's using your systems current settings.
Once you're in the data model, that is when you pick your date format strings. Notice that both images use the same data, the green is the data type in Power Query.
Blue is the format string that lets you override the defaults.

Kendo Grid "Date" formatter "day" of the week need to be capitalized from "Mon to MON"

i'm using the below format to show date with day of the week like "12/30/2015 - Mon". but need to show the day in capitalized form like "MON" instead of "Mon"
columns.Bound(p => p.Date).Width(100).Format("{0:MM/dd/yyyy - ddd}");
The Kendo datetime formatting support has nothing to control the capitalisation of the output.
Probably the easiest way is to do this explicitly on the client.
In the grid set up:
columns.Bound(p => p.Date).Width(100).ClientTemplate("#:formatUpcaseDate(Date)#");
and then in your JavaScript format and convert to upper-case:
function formatUpcaseDate(d) {
return kendo.toString(d, 'MM/dd/yyyy - ddd').toLocaleUpperCase();
}

How to manipulate the date format in reminders

The date in reminder is US format ( mm/dd/yyyy) By default I guess. How to manipulate the collection of reminders and format the date to british format so that the listBox will show the reminders as below:
Begin Date ( in British Format or non-US format)
Content
MyReminders = ScheduledActionService.GetActions()
.Where(a => a.BeginTime.Date == Today);
foreach (Reminder r in MyReminders)
{
// How to change the date format to British in each of the reminder and display
in the listBox?
}
ReminderListBox.ItemsSource = MyReminders;
In the list Box :
&ltListBox Name="ReminderListBox" Margin="1,116,-2,4" &gt
&ltListBox.ItemTemplate&gt
&ltDataTemplate&gt
&ltGrid Background="Transparent" Margin="0,0,0,30"&gt
&ltStackPanel Orientation="Horizontal" &gt
&ltTextBlock Text="begin "/&gt
&ltTextBlock Text="{Binding BeginTime}" HorizontalAlignment="Right"/&gt
&lt/StackPanel&gt
&lt/Grid&gt
&lt/DataTemplate/&gt
&lt/ListBox.ItemTemplate/&gt
&lt/ListBox /&gt
problems : I dont want to set the date format in the listbox. I want to dynamically detect the locale and display the date Format base on the detected locale Ex Non-US format for Jpn, Kor, China
What does your listbox template look like? You should be able to make it pick the "right" date format for the culture using a format specifier of "d" (for short date) or "D" (for long date) ... and I'd expect you to be able to do that from XAML rather than changing anything else.
Note that the DateTime itself doesn't have a format - so it's not like you could set that value to be "in" UK format.
EDIT: I think you want:
{Binding BeginTime, StringFormat=d}
or if you want to force a specific format (which I don't recommend)
{Binding BeginTime, StringFormat=dd/MM/yyyy}

Concatenate DateTimePicker in VS2010

How can I concatenate the values of two datetimepicker?
DateTimePicker1 - this is for the the DATE mm/dd/yyyy
DateTimePicker2 - this is for the the TIME hh:mm:ss
I want a value of ... mm/dd/yyy hh:mm:ss in one variable, how can I do that?
One easy way would be
DateTime dt = new DateTime(dtp1.Year, dtp1.Month, dtp1.Day, dtp2.Hour, dtp2.Minute, dtp2.Second);
Please check the order of the parameters, I am writing from memory.
Here dtp1 is a DateTime object from the first datetime picker.

Resources