mikeage.net Logo
mikeage.net/2007/02/13/small-fix-to-hebrewdate-plugin/

mikeage.net @ ב׳ אייר תשע״ז

Small Fix to HebrewDate plugin

I've released a small fix to the HebrewDate plugin. The new version is 1.0.2, and is available, at the regular place.

12 Responses to “Small Fix to HebrewDate plugin”

  1. KosherJava says:

    Mike,
    I noticed that if I echo out with the new 1.0.2 version that it just echos out the time (2:10). Unrelated to the new version, but in 1.0.1 if I have the plugin set to pick up the sunset changes, shows tomorrow's Hebrew date today. My server is in GMT -8 (California) while my WordPress is set to GMT -5. Any ideas?

  2. KosherJava says:

    Looks like using <code> did not work.

    Mike,
    I noticed that if I echo out <?php the_time(); ?> with the new 1.0.2 version that it just echos out the time (2:10). Unrelated to the new version, but in 1.0.1 if I have the plugin set to pick up the sunset changes, <?php the_time(); ?> shows tomorrow's Hebrew date today. My server is in GMT -8 (California) while my WordPress is set to GMT -5. Any ideas?

  3. Mike Miller says:

    A quick note on ; if you want the angle brackets to show up, use . I had a preview plugin, but it's broken with WordPress 2.1.

    First, regarding the_time. The plugin wraps the_time, only; not the_date. If it finds a colon without a comma, it assumes that it's just outputting a time, and not a date, and thus does not do anything (as per your original code). This is necessary to handle printing of dates and times; in my theme, I use:
    Posted on < ?php the_time('l, F jS, Y') ?> at < ?php the_time('H:i') ?> to handle the printout of date/time. For comments, the plugin also traps comment_date(), but not comment_time(). Does that help?

    Regarding the sunset issue... I don't know exactly why. My server is in GMT-8, and wordpress is set to GMT+2, and it works for me ;). Is it wrong for the entire day, or does it just switch early?

  4. KosherJava says:

    Mike sorry for the confusion. I had been using the_time when I meant to try to output the current time in the header (see the top left corner of my site) and not the time of the last post. This has been rectified by using the slightly more verbose, but correct:

    <?php echo date(get_settings('date_format'));?>- <?php if (function_exists('hebrewDateCurrent')) {echo " – "; hebrewDateCurrent();} ?>

    The issue with the time of sunset might have been related and I will test this tomorrow. I would suggest displaying a link to the download page and the current version of the plugin in the plugin options page. You should consider adding a function currentDate() (maybe there should be a better name) that would echo out the date the same way that I displayed above (based on the users prefered display of Hebrew dates). This would be in addition to the hebrewDateCurrent(); Sample usage of hebrewDateCurrent() should be part of the preference page, for lack of a better place to put it.

  5. Mike Miller says:

    Just to clarify: you'd like currentDate() to output both date() and HebrewDateCurrent()?

    I'll work on 1.0.3 today and tomorrow.. depends how busy I'll be.

  6. Mike Miller says:

    Please take a look at http://mikeage.net/test-page/ and see if this is what you were referring to.

    currentHebrewDate now accepts two parameters:
    The first is either a standard php date() formatting string, or the literal "date_format", which will cause it to use the WordPress default. The second is either "before" or "after", and controls where the Hebrew Date is placed. The default, if either is not defined, is to output only the Hebrew Date (legacy behavior).

    If you like it, I'll release 1.0.3 today (including some better documentation)

  7. KosherJava says:

    What you built is nice but probably overkill. Why do

    hebrewDateCurrent("date_format","after"): February 14, 2007-כ"ז שבט תשס"ז
    hebrewDateCurrent("F y H:m","after"): February 07 11:02-כ"ז שבט תשס"ז

    return different values?
    the pwer usage in the test site is nice but overly complicated to non developers. I think that there should be 2 ways to get the the value in a very simple manned. The hebrew only and that would depend on the setting to pick up "Character Set" settings, and a way to echo out the current time based on the setting in both the Character Set and Display Style.

  8. Mike Miller says:

    not only is it nice, but it only took about 15 minutes 😉
    They return different values since my date_format string is not F y H:m. That's actually a fairly useless format; it was chosen at random. Maybe I can add a third value ("default") which will output the same value you'd get from the_time() within The Loop.

  9. KosherJava says:

    Default would be nice.
    hebrewDateCurrent() – would output Just the Hebrew date based on the charset selected by the user in the config (either כ"ז שבט תשס"ז or 27 Shevat 5767)
    hebrewDateCurrent('default') – would output it in the same format that is used by the_time() within the loop
    …. for all the rest of the formats in the test page (including setting the charest, before/after, menachem av VS Av, meaning that there should probably be a way to set the config via this function, but that might be too complex. Whatever is done, it should be documented.
    On the TODO should be support for Hebrew WordPress, as well as other languages.
    One place to look for ideas are the Hirji and Jalali plugins linked at http://codex.wordpress.org/Plugins/Time .

  10. Mike Miller says:

    ok, done. tests are on the test page mentioned earlier.

  11. mikeage.net says:

    Hebrew Dates v1.0.3…

    Based on feedback from KosherJava (on the v1.0.2. release announcement), I've enhanced the currentHebrewDate() API in the Hebrew Dates plugin. It now accepts parameters to control how the date is printed.

    Usage
    HebrewDate provides an API, hebrewDateC…

  12. Mike,
    I made some changes to the plugin provided by Kosherjava, you might be interested.
    You can see it here http://kosherdev.com/2009/11/hebrew-date-plugin-jq-them/
    But unfortunately, I found your continuation of development too late, that is why my changes were applied only to version 0.9.

    Now, I work on development of Zmanim Widget (http://kosherdev.com/category/dev/zmanim-widget/) and I use there some functions from Hebrew date plugin. We could work together on these projects, due to using common functions set.

Leave a Reply

Quick Map
Content +
Personal +
Archives +
Site Stuff +
RBS Weather +
Search +
Recent Images
Visitors
Clustermap

Valid XHTML 1.1!
Printer Friendly Page
 

Last Modified: September 04, 2006 @ 02:11 CST

Memory(TRUE): 2097152/2097152
Memory(FALSE): 1827512/1837056