Bind grid from web api controller - kendo-ui-angular2

I'm trying bind grid from a web api controller, the date column is displaying as: 2018-01-08T09:46:47.6451288.
I want to format the date and I have tried the below. I am assuming that it isn't parsed as a Date which is why it isn't being formatted.
How do I get it to come in as a parsed date from the controller?
Thanks in advance!
<kendo-grid-column field="createDate" title="Create Date" format="{0:MM/dd/yyyy}" width="125">
</kendo-grid-column>

Related

show date in correct format angular

I am making an application in which I want user to submit date date is getting stored in database in this format 2003-06-01T00:00:00.000+00:00 I want to display it as 01/06/2003 or 1st June 2003 can any body help me how can I do this?
You can use angular date pipe
https://angular.io/api/common/DatePipe
<span>{{startDate | date:'MM/dd/yyyy'}}</span>
I have created a small stackblitz for this. You can see date being formatted 4 different ways here:
Plain old javascript date
Formatted Javascript Date
Using Angular Pipe in HTML file
Using formateDate() function in component.ts file.
Please refer to this link: https://stackblitz.com/edit/angular-cue9h6?file=src%2Fapp%2Fapp.component.html
You could use date pipe to format your standard ISO date in html template. Find the date object from your template, wrap the value in {{}} and then add | date pipe to format it. https://angular.io/api/common/DatePipe
<td>{{date}} </td>
<td>yyyy-MM-dd</td>
<td>{{date | localDate:'yyyy-MM-dd' }}</td>
<td>{{date | date:'yyyy-MM-dd'}}</td>
Here is a working example: https://stackblitz.com/edit/angular-local-date-pipe-bu2nxp?file=src%2Fapp%2Fapp.component.html

How to get the date from and to fields of filter in prestashop controller

I want get the date from and date to field, selected in date filter search. Need these fields to get PDF report sorted on search filed bases.
Just take a look at some of the core stats* modules, where this is automatically supported.

How to format a SharePoint ListItemProperty Date Field

I've got a SharePoint (2010) list with a date field on it.
Now in my custom display form I can go ahead and add the field
<SharePoint:ListItemProperty Property="MyDateField" runat="server" id="ListItemProperty1" />
which results in the following output
21.02.2011 15:44
How can I tell SharePoint to format the Date to
21.02.2011
The only way so far seems to be to create a new calculated column based on that date field and do the formatting within the field definition, but that kind of seems to be the wrong way.
Any help would be much appreciated.
When you create the "Date" column in the list, there is option to select: 1)Date only ; 2)Date and time.
If you select the first option, then in the display form, only the date is shown
I had a similar task to perform recently, but the client wanted the time stored as well as date, just not to display the date.
The way I got around this was to create a Calculated Column which displayed the date in the format required, and I then just pointed my field control to display that column.
The calculated column had this formula:
=TEXT([News Article Date],"dd MMMM yyyy")
FYI: this was in a page layout.
Please see http://panvega.wordpress.com/2008/12/08/ddwrtformatdate-with-different-formatflags/ for custom pages.
programmatically (powershell):
$web = get-spweb http://thingy/
$list = $web.lists["List Name"]
$datefield = $list.fields["Date Field"]
$datefield.displayformat = [microsoft.sharepoint.spdatetimefieldformattype]::dateonly
$datefield.update()

How to get the Current Date & Time Automatically to a Date Time Field

I have created a date time field I made today's date as the default value, Then I added it to a page layout and created a page, But the current Date Time is not picking up from the system.
I dont want to give the user to select a Date Time instead it should populated automatically
Is there anyway to achieve this without writing code in code behind files?
This is very similar to this question I think
SO - How to get Date and current time from the Date/Time column in SharePoint Custom list
My answer there gives a few options such as using the built in Created field, using a calendar template, a JavaScript hack and a custom field type.
Guys, fake [Today] trick worked for us - but prob is we only got the date value not datetime.
Janis, is it possible to get date and time both from the fake [today] column trick? pls refer few articles on the same
Does [Today] work?
If you have language pack applied to SharePoint, then you must use localized "Today" string.

Sharepoint, Create View, Filter Properties

I'd like to create a view in Sharepoint that has a filter based on a date field.
The filter should be >= Today and <- Today + 90 days.
I found a reference to the
<Today OffsetDays=”5” />
CAML function and could probably use this by setting the view using the API.
My question is how do i set this using the browser based admin page?
alt text http://www.isuppli.com/Img/Development/CreateViewSample.gif
This can be done OTB using the filter dropdowns when modifying or creating a view:
Filter Image
alt text http://img91.imageshack.us/my.php?image=filterew5.png
Edit: Fixed image
Ok... when you using formula for the column...
It cant using [Today] because it doesnt exsist on the list column...]
So i suggest that you must required the column Today first, so you can use [Today] At the formula..
i think u just dont have using CAML or column formula, but it can do from filtering like AdamBT says...
Hehehe...

Resources