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.
I've released a small fix to the HebrewDate plugin. The new version is 1.0.2, and is available, at the regular place.
כ"ו שבט תשס"ז - February 13, 2007 at 9:07 pm
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?כ"ו שבט תשס"ז - February 13, 2007 at 9:10 pm
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?
כ"ו שבט תשס"ז - February 13, 2007 at 9:58 pm
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; notthe_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 trapscomment_date(), butnot 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?
כ"ז שבט תשס"ז - February 14, 2007 at 4:04 am
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:
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.
כ"ז שבט תשס"ז - February 14, 2007 at 5:58 am
Just to clarify: you'd like
currentDate()to output bothdate()andHebrewDateCurrent()?I'll work on 1.0.3 today and tomorrow.. depends how busy I'll be.
כ"ז שבט תשס"ז - February 14, 2007 at 10:33 am
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)
כ"ז שבט תשס"ז - February 14, 2007 at 6:53 pm
What you built is nice but probably overkill. Why do
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.
כ"ז שבט תשס"ז - February 14, 2007 at 7:37 pm
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 fromthe_time()within The Loop.כ"ז שבט תשס"ז - February 14, 2007 at 8:04 pm
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 .
כ"ז שבט תשס"ז - February 14, 2007 at 8:48 pm
ok, done. tests are on the test page mentioned earlier.
כ"ח שבט תשס"ז - February 15, 2007 at 5:57 am
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…