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?
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?
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 at 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?
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.
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)
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.
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.
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.
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.
12 responses to “Small Fix to HebrewDate plugin”
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?
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?
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 at
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?
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.
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.
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)
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.
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.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 .
ok, done. tests are on the test page mentioned earlier.
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…
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.