Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > displaying time zones manually View modes: 
User avatar
Member
Member
dcollins-marketwired - 2/10/2014 3:36:04 PM
   
displaying time zones manually
I am reading up on time zones, but I think that may be more than I need.

My homepage has a news article repeater, for which I have made a document type. The doc will hold title, blurb, author and publish date/time. They are all text fields, except the date/time, which is a calendar picker. I need to incorporate timezone.

Now, I'm toying with enabling the timezone functionality via System, but, since I expect that a news article will be entered manually much of the time, it may be overkill to try to bind the time zone display to the document, I think they'll just pick the right timezone manually.

Is there a way of exposing the time-zones so that that it can be chosen in or alongside the calendar picker?

Also, I am trying to format the timezone into the display as well, but I haven't figured that out.
<%# FormatDateTime(Eval("date_time"), "dddd, MMMM d,  h:mm tt K") %>

The K is empty (probably because my date object has no timezone data in it.)

I suppose the most expedient solution to both of these thing is to simply provide a dumb text field, and have the site admin enter whatever they need... "EST", "CST", etc. that spits it, unprocessed onto the page.

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/11/2014 1:21:32 AM
   
RE:displaying time zones manually
Hi,

Thank you for your message.

You cannot change or choose the time zone in the date calendar form control. What you can however do is set your Time zone of the e.g. repeater to use User time zone.

Also to format date please try something like this:
<%# GetDateTime("date_time", "MM/dd/yy HH:mm") %>

This should be able to format your date according to the formatting string.

Kind regards,
Richard Sustek

User avatar
Member
Member
dcollins-marketwired - 2/11/2014 8:29:53 AM
   
RE:displaying time zones manually
Kentico_RichardS wrote: You cannot change or choose the time zone in the date calendar form control.

Yeah that makes sense. It's normally not supposed to be settable.
Kentico_RichardS wrote: What you can however do is set your Time zone of the e.g. repeater to use User time zone.

Not sure what that would accomplish for me. The date/time/zone need to be entered manually when the article is posted by the administrator (unlikely it will be posted directly by the original author). So the date/time/zone being entered will likely have no correlation with current date/time/zone.

i.e.: An author writes an article (or posts a public news release) on January 1 2014 at 8AM CST. The next day an administrator posts it to the news section. It is now January 2, 2014 at 11AM EST but the admin needs to grab the Jan 1 8AM CST.
Kentico_RichardS wrote: Also to format date please try something like this:
<%# GetDateTime("date_time", "MM/dd/yy HH:mm") %>

This should be able to format your date according to the formatting string.

Not sure how that's better than mine. Mine works perfectly.

User avatar
Member
Member
dcollins-marketwired - 2/11/2014 8:35:15 AM
   
RE:displaying time zones manually
Maybe what I should do is create a new field in my doctype form that is a dropdown containing all timezones, and the admin just picks a timezone from that.

I'm going to go looking for a way that K can deliver a list of timezones to popuate a dropdown.

(I think what I may do as well is provide a free text field so that the admin can bypass the calendar/timezone web parts altogether, and simply copy/paste a static string of date/time - say, if the author provided it in the article.)

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/12/2014 12:59:24 AM
   
RE:displaying time zones manually
Hi,

Thank you for your message.

What do you mean by
but the admin needs to grab the Jan 1 8AM CST.
? What exactly are you trying to accomplish?

It seems a little overcomplicated to me if I understand you correctly. e.g. why dont you have an addional field like Release date in your news and simply hold the release date there?

Kind regards,
Richard Sustek

User avatar
Member
Member
dcollins-marketwired - 2/12/2014 9:10:40 AM
   
RE:displaying time zones manually
Kentico_RichardS wrote:
why dont you have an addional field like Release date in your news and simply hold the release date there?

Exactly, but I'm trying to make their job easier by providing tools where they don't have to type in the entire thing manually. This is particularly important in ensuring that the format is consistent from article to article over months. They are unlikely to remember the correct date/time format each time so that it looks consistent between all artricles on the page.

(Admittedly one low-tech way to ensure consistency is to simply provide a prompt next to the input field, that says "Month day, yyyy hh:mmA/P TZ" )

User avatar
Kentico Consulting
Kentico Consulting
Kentico_RichardS - 2/13/2014 12:53:45 AM
   
RE:displaying time zones manually
Hi,

Well, the best way is really to have the Release date field separated since sometimes you would like to have it different and its really easier to manage. Its not that much of an additional work. You can have Date form control for this field too.

If you look into our corporate site you could see that we are also using exactly same field for our news document type.

Kind regards,
Richard Sustek