ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Create a Program Schedule with Timezone support

September 21, 2009 9:31pm

Subscribe [1]
  • #1 / Sep 21, 2009 9:31pm

    inoa

    35 posts

    Hi all,

    This is a question for someone with good technical knowledge… We’re willing to pay for help too, if necessary—send a PM with your proposal!

    Basically, we’re pulling from an editable table (using FF Matrix) on the backend that returns editable variables for each day - {monday}, {tuesday}, etc.

    Each of these variables can hold two times, such as 7:00/11:00—the hour part here can be matched in every case with the regex formula “(\d{1,2}):” Also, it’s in 12-hour time, since we recycle programs each am & pm.

    What we’d like to do is have this all adjustable by timezone. I know there are some good javaScripts out there for detecting browser timezones… and/or we could just have a pulldown menu populated with timezones that returns an offset or something…

    So I was thinking about something like this:

    $offset = variable (- or +)
    $string = {monday}
    preg_match string for (\d{1,2}):
    replace this with $1 +/- variable
    but if variable = 13, then change it to 1
    output string again, so that 12:00/1:00 could become 1:00/2:00 or something like that.

    Is there an easier way to do this? Is there any way to pull in EE’s localization class here (http://expressionengine.com/docs/development/usage/localization.html), or can anyone point me in the right direction? My PHP knowledge is not great.

    Thanks,

    John

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases