EE: Nice Date plugin

Low Nice Date is an ExpressionEngine plugin takes a certain date and format and outputs the given date in the given format, localized or not. This post now provides a place for support for the Low Nice Date plugin.

Download and docs for Low Nice Date can be found in the Software section

May 6th 2007 | Add-Ons, ExpressionEngine | 24 comments

Comments

  1. 1 Dan May 12th 2007, 17:49

    How do you set the date in the url using expression engine? I noticed that your archives, you have the dates in the url, nice.

  2. 2 Low May 13th 2007, 13:55

    Dan, I use urls like this:
    {path=archive}{entry_date format="%Y/%m/%d/"}{url_title}/

    Then I use the url_title segment to fetch the right entry. But you need 2 hacks to display the comments and comment form, though.

  3. 3 Dan May 17th 2007, 07:18

    Thanks. I ran across your post on the EE forums titled “url_title parameter in comment module.” I think it’s a good idea. When you say hack, does that mean into the core?

  4. 4 Low May 22nd 2007, 15:51

    Yes, you need to edit the mod.comment.php file.

  5. 5 Steffen July 11th 2007, 09:59

    Sers Low,

    one question… what do i have to edit in the mod.comment.php? Can you tell us? ;)

  6. 6 Low July 13th 2007, 17:01

    Steffen, a hack is no longer needed, since EE 1.6 now supports the url_title parameter in said tags!

  7. 7 fodney October 2nd 2007, 21:40

    I’m getting some strange results. Using:

    {exp:nice_date date=”{segment_3} {segment_2}” format=”%F %Y”}

    http://www.sturgislibrary.org/calendar/2008/04/

    I get December 1969

    Should get April 2008

    Ideas?

    Thanks

  8. 8 Low October 2nd 2007, 21:48

    fodney, try making an unambiguous date as input, for example: {exp:nice_date date="15-{segment_3}-{segment_2}" format="%F %Y"}

    Like this, the php function strtotime, used by this plugin, will recognize the date you’re trying to format.

  9. 9 fodney October 3rd 2007, 14:24

    Thanks Low. I got it. I just had my segments in the wrong order.

  10. 10 bob July 3rd 2008, 00:49

    hi low,

    I’m having some problems with your plugin. this code isn’t working for me:

    {exp:nice_date date=”{exp:truncate max=”11″ rep=” “}{cat_folder}{/exp:truncate}” format=”%F %j%S, %Y” localize=”yes”}

    the cat_folder is a variable of which the first 11 chars consist of a date. example: “2008-05-30 Superglue @ Fuse, Brussels” is truncated to “2008-05-30″. but there is no output whatsoever. is there a solution that allows me to keep the truncate functionality?

  11. 11 Low July 3rd 2008, 09:08

    I’m afraid you can’t use another plugin tag as parameter input, bob. In this case, you’d probably have to use php instead of the truncate plugin to get the substring you need.

  12. 12 Steven Hambleton July 16th 2008, 08:35

    Is there a way of only having the first 3 letters of the month such as Jun, Mar or Sep?

  13. 13 Low July 16th 2008, 09:08

    There is, Steven. As long as the date attribute contains a complete date, you can format it any way you want. So, in the second example, you could use format="%M" to get your result.

  14. 14 Steven Hambleton July 16th 2008, 10:13

    Can you give me an example? I’m not quite following how this works…

  15. 15 Steven Hambleton July 16th 2008, 10:26

    I understand what you mean now. I should get some sleep :)

  16. 16 Andy Harris July 22nd 2008, 13:26

    Great plugin, did just what I needed. Thanks muchly.

  17. 17 Hambo July 13th 2009, 04:08

    Hi Low,

    I have the following code -

    {exp:nice_date date="{entry_date format="%Y-%m-%d-%g-%i"}" format="%j%S %F %Y - %g:%i%a" localize="yes"}

    My entry time is 2:30pm but the output says 2:00pm. Any ideas?

  18. 18 Low July 13th 2009, 08:23

    Hey steve. Try this: {exp:nice_date date="{entry_date format="%Y-%m-%d %H:%i"}" format="%j%S %F %Y - %g:%i%a" localize="yes"}

    Or this: {entry_date format="%j%S %F %Y - %g:%i%a"} :)

  19. 19 Erwin van Lun November 26th 2009, 13:38

    Hi Lodewijk.

    Good to be back again on your website.

    I’m looking for a date plugin that converts a date/time to
    5 hours ago
    1 hour ago
    32 minutes ago
    But when it’s more than 36 hours ago, then the date should be May 15th, 2009 (without a timestamp).

  20. 20 Low November 26th 2009, 14:05

    Hey Erwin. There is no single plugin that does that at the moment. You’ll have to use a combination of the Relative Date plugin and PHP on output, I think.

  21. 21 Low November 26th 2009, 14:07

    Or, just use the relative date variable and some conditionals, perhaps?

  22. 22 Erwin van Lun November 26th 2009, 14:22

    I was actually waiting for a guy from Holland writing this plugin :-)

  23. 23 Tyler March 10th 2010, 20:39

    Any chance there is a way to get this to output French months.

  24. 24 Tyler March 10th 2010, 21:11

    oh nevermind. lol. conditional statements are awesome.

Commenting is not available in this weblog entry.