WordPress.org

Ready to get started?Download WordPress

Forums

wp-forecast
[resolved] Date formatting (8 posts)

  1. Tafra
    Member
    Posted 1 year ago #

    Hello, is it possible to change the date format inside <div class="wp-forecast-fc-head"></div>? Thank you!

    http://wordpress.org/extend/plugins/wp-forecast/

  2. tuxlog
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tafra,

    wp-forecast uses the date format of your blog.
    If you want to change this you can edit funclib.php at line 286/287.

    $av['fc_date_format']=get_option("date_format");
    $av['fc_time_format']=get_option("time_format");

  3. crabbster
    Member
    Posted 1 year ago #

    Hey there!
    First of all tuxlog, thanks for all your work and prompt replies to posts. I'm having difficulties with changing the time format. What needs to be replaced in "get_option("time_format")? I tried to replace it with PHP time formatting code but couldn't get it to work. I need to change 17:36 to 2:36 pm.

    So $av['fc_time_format'] = what's here?;

    I tried variations of $av['fc_time_format']= 'g:i A'; but couldn't get it to work.

    Thanks much!
    Kim

    P.S. I am VERY new to PHP programming if you can't tell. :)

  4. tuxlog
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Kim,

    changing time from 17:36 to 2:36 pm is not only a formatting matter. It is also a timezone matter. right?

    Lets start with the format. Which format do you use in your Blog and should it be the same as you like in wp-forecast? wp-forecast takes the same format as your Blog does.

    g:i A looks allwright to me. What exactly does not work?

    Now the second part. Which timezone is set in your Blog and what timezone do you like in wp-forecast? You can adjust this in the admin dialog for each widget.

  5. crabbster
    Member
    Posted 1 year ago #

    I do have my blog set to CST timezone and have the time set to display as 2:00 pm which is what I would like it to be in wp-forecast. What's also kind of fishy is that the iframe language is set at de-DE but it should be en-US. Below are links to screen shots of all these elements.

    What it looks like (can't see it live because it's on my local machine): http://www.sockerswi.org/images/wp-forecastScreenprint.jpg

    Widget settings: (I also tried clicking "use current time" checkbox and it had no effect) http://www.sockerswi.org/images/wp-forecast_widgetsettings.jpg

    Blog timezone settings:
    http://www.sockerswi.org/images/blogtimezonesettings.jpg

    Fishy iFrame code:
    http://www.sockerswi.org/images/wp-forecast_iFramescreenshot.jpg

    It seems like everything's in order...

  6. tuxlog
    Member
    Plugin Author

    Posted 1 year ago #

    Ahhhhh, I was on the wrong track...

    1. wrong sunrise time format --> until now wp-forecast only formats the current time not the sunrise time. But you are right it should be convert these too. Please fetch https://dl.dropbox.com/u/107546706/func_accu.php and try if its better now

    2. wrong header in iFrame --> de-DE was hardcoded in it, I now changed this to the language the widget uses. Please fetch https://dl.dropbox.com/u/107546706/wp-forecast-show.php and try it

    I am not sure if we have a 3. with your timezone. Maybe we should do 1. and 2. first. You are really a pro, Kim :-)

  7. crabbster
    Member
    Posted 1 year ago #

    That all makes sense, I didn't even think about the sunrise/sunset being different. Glad I included my handy screen prints otherwise we would have had quite the go-round. I love screen prints. :)

    Sunrise / sunset happiness: http://www.sockerswi.org/images/wp-forecastScreenprintBAM.jpg
    No more fish! http://www.sockerswi.org/images/wp-forecast_iFramescreenshotBAM.jpg

    YOU are the pro, and a speedy one at that! :) Thanks so much and have a great rest of your Sunday!

  8. tuxlog
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Kim,

    great it worked. I will add this functionality to the next release.
    Thank you for the hints on this and have nice Sunday.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.