Kentico - Not able to save the DateTime in "DD/MM/YYYY" format - kentico

I am working on Kentico 12 MVC Site in version 12.0.59 and default culture set to "en-AU".
I have created a Form named "Sample Form".
When I am trying to save the datetime in either "MM/DD/YYYY" or "YYYY/MM/DD" it works correctly and saves the data in the database for the form.
But when I try to save the datetime in format "DD/MM/YYYY" and click on Submit button to save the data in database, it shows the error as follows:
Can anyone please suggest for the same?
Thanks

One potential reason for that is a missing culture setting for the current thread in the code. It is not enough just to select the default culture "en-AU" in the Kentico admin interface. In the code before processing your request you should set the desired culture for the thread as well:
Thread.CurrentThread.CurrentUICulture = yourDefaultOrSelectedCulture;
Thread.CurrentThread.CurrentCulture = yourDefaultOrSelectedCulture;
In Kentico example Dancing Goat MVC website you can see this implemented in MultiCultureMvcRouteHandler.cs code file.

Related

how can I show yesterday's page view statistics in Kentico?

I want to show yesterday page view statistics statistic in kentico10
I have used page view web part, but it doesn't include yesterday field as shown below.
But it doesn't include yesterday field!
One approach would be to clone the biult in webpart (Page Views) which creates a copy of the webpart in the database and copies the code files to the filesystem. Then you would edit the StatisticsType property, add in a new value for yesterday
Yesterday would be added in a value into the datasource:
Then in the C# code behind of the .cs class you would edit Reload data to handle the yesterday query the way the other queries are handled.
You would simply set the correct fromDate, startDate, and Interval type to represent "yesterday".
I don't recommend editing the built in webpart because that is not a 100% upgrade safe change.

liferay 7 date field pre populate with current date

I've created a new form in Liferay 7 and added a date field. I would like the form to pre populate with the current date when the page is loaded. Is it possible to do this?
No, not with the DateDDMFormFieldType Liferay provides.
You could of course write your own implementation based on Liferay's which could offer the possibility of choosing the User's current Date as default value or render it always (as some kind of CurrentDateDDMFormFieldType or whatever you'd like to call it).
Some links you might find useful:
Liferay's DateDDMFormFieldType implementation
Liferay's tutorial for implementing your own DDMFormFieldType

How to get the date of the content initial published date?

In Kentico, is there a way to know the date the content was published for the first time? In the view_cms_tree_joined view there are fields called DocumentLastPublished and DocumentCreatedWhen but the latter is populated when the user save the content initially even if it's not published and the former is updated when the content is republished. Should I look at the workflowversionhistory?
You'd have to look through the workflow history for that document and get the initial publish state. If you don't want to do that (might be pretty messy and lengthy) you could always add a field to the page type for an initial publish date which will allow someone to add that date or default to when it is saved and not allow it to be editable after it is saved by using a macro on the enabled property of that field.

Orchard : DateTime Field doesn't appear in search index

I have created one content part say News which is attachable, having one property of type DateTime
I have attached this content part to one content type.
in content type I have set "Include in index" for my DateTime field of content part.
now i have created one index say NewsIndex.
Set this newsIndex in content type (Published Version)
Rebuild index.
now when i go to Settings->Search, I am not able to see my DateTime field check box over there.
I am using Orchard version : 1.10.1.0
I have tried above situation by both way.. (From admin dashboard and using Code)
Facing this issue since 5 day, trying a lot but not able to get success. Really needed help on this.

How to format link in email to open an Xpage App

I am sending out an HTML email to our users every week in which I want to include links to certain documents and then a link to the overall database. The database is an Xpage db.
On my docs I have a field only visible to me in which I compute the link I need. The format is as follows:
notes://servername/__.nsf/0/?OpenDocument
What I want is the URL to open not just a specific document, but the Xpages app in general. Everything I try opens up the all documents view.
notes://servername/__.nsf/
If I put this in the address bar, it works fine. If I put it in a link, it goes to the all documents view.
Any help would be greatly appreciated.
You could try formatting it as: notes://servername/__.nsf/nameOfXpageYouWantToOpenTo.xsp?OpenXPage
Have you set the launch properties for the database? You can specify a designated XPage in there too.
The format you are looking for is:
notes://servername/yourdb.nsf/someview/unid?OpenDocument
in the "someview" view you add a form formula to point to an empty form that has the property set "open XPage instead" - careful there are 2 of them: for web and client.
If you don't use native forms and the Xpage is always the same, then you can skip the step with the form formula and the extra form and edit the properties of the existing form.
Paul's solution should work too.
Use this code syntax to open any XPage in the Notes client:
#URLOpen("notes://Host/Path/Database.nsf/XPageName.xsp?OpenXPage")
Additional details:
And use the following to open a specific document in the XPage where unid is the unique document identifier for the document:
#URLOpen("notes://Host/Path/Database.nsf/XPageName.xsp?documentId=unid&action=openDocument")

Resources