Module provides additional options for displaying date type fields. You can configure how to show the date for the different values of field.
If the field value
- less than yesterday,
- equally yesterday,
- equally today,
- equally tomorrow,
- greater than tomorrow.
You can choose any format added to the your site - /admin/config/regional/date-time.
Additionally, field return with html classes:
for "today" - <span class="more-dates-today">Value date field with format for today</span>
for "yesterday" - <span class="more-dates-yesterday">Value date field with format for yesterday </span>
and etc.
Example of use: you have a node "Event" and you want to show today's date as format "HH:ii", yesterday - as format "DD MM YY", and tomorrow - as "dd FF YY HH:ii".
Related projects:
(if you have a module that you think is related, submit an issue and I will add it here)
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/mbodalova/2212053.git more_dates
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | patch_0001.patch | 2.28 KB | nicorac |
| #5 | settings manage display.png | 32.96 KB | MerryHamster |
| #5 | settings in views for field.png | 49.39 KB | MerryHamster |
| #5 | settings in views.png | 15.19 KB | MerryHamster |
Comments
Comment #1
MerryHamster commentedComment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxmbodalova2212053git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
frankbaele commented1) the module does not seem to work with regular date notation or unix timestamp. Check line 123,124 more_date.modules
2) formatter settings can be a extended a bit more
3) the rest of the module seems fine and well written
Comment #4
MerryHamster commentedComment #5
MerryHamster commentedComment #6
MerryHamster commentedComment #7
MerryHamster commentedComment #8
MerryHamster commentedComment #9
MerryHamster commented@frankbaele thanks for your comment.
I changed field type.
Now formatter work for 'datetime'.
Comment #10
MerryHamster commentedI'm going to do for date and datestamp a little later.
Comment #11
MerryHamster commentedComment #12
nicorac commentedI had a look at your code and I found some Drupal coding style issues:
more_dates.module:
missing @file file comment
more_dates.module (11):
should read "Implements hook_field_formatter_info()."
more_dates.module (39):
$key variable is not used, so
foreach ($date_types as $value)should be usedmore_dates.module (109):
useless inline assignment to variable $current_time (not used anywhere)
more_dates.module (141):
bad indentation (4 spaces instead of 2)
more_dates.views.inc (7):
should read "Implements hook_views_data_alter()."
I attached a patch for these.
Comment #13
nicorac commentedYou should also add a README.txt file.
Comment #14
MerryHamster commentedComment #15
MerryHamster commented@nicorac thanks for your comment and patch.
File README.txt added.
Comment #16
MerryHamster commentedComment #17
MerryHamster commentedComment #18
MerryHamster commentedComment #19
MerryHamster commentedComment #20
santiwww commentedJust a few minor things:
Some typos:
readme.txt (lines 22,27,30)
more_dates.module (line 22)
Not an error but a convention, in module line 145 the CSS class uses a value that could include an underscore instead of a dash.
Comment #21
Anthony Goode commentedHi MerryHamster,
I found some errors reported by automated review tools of http://pareview.sh.
All in the file
more_dates_views_handler_field_date.inc.This is a minor question, is the
more_dates_format_nice_viewa helper function?, If so neither an error but another convention, it is recommended that its parameters are documented.I agree with the previous comment #3 of frankbaele, the rest of the module seems fine and well written.
Comment #22
vtkachenko commentedCurrently I found some issues. One of them is realy bug. Other are really minor.
1. In function more_dates_format_nice_view you use definition sign "=" instead of equal sign "==" :
2. In function more_dates_views_data_alter you can pass 'title' through "t" function:
3. Some typo in file README.txt :
Comma is missed:
Only five settings:
- less than yesterday,
- equally yesterday,
- equally today
- equally tomorrow
- greater than tomorrow.
"date puplish" instead of "date publish".
"bithday" instead of "birthday".
Good luck.
Comment #23
MerryHamster commentedHello.
Thank you for your commits. Added changes.
Comment #24
MerryHamster commentedComment #25
subhojit777Found some pareview issues: http://pareview.sh/pareview/httpgitdrupalorgsandboxmbodalova2212053
Though english is not my native language, but you need to fix certain help text, they seem confusing. For example, The date format which will be used for field value until than day ago., it should show "Format for dates before yesterday". For today's date, "Format for today's date." It should be kept as simple as possible, and also considering the proper meaning at the same time.
Found some issues. I tested the settings with date (unix timestamp) field and it was not working. However it worked for date field. You need to make sure it works for all date type fields.
Instead of
'<span class="more-dates-' . $format . '">' . format_date($value, $config[$format]) . '</span>', you should use theme_html_tag(), this way you will follow Drupal standards for writing HTML.Did a manual review and your code seems ok.
I have not used custom formatters module before, but I guess we can do the same (as your module does) in custom formatters. Even if it does not provides as good features as your module, but you should consider making this module more flexible, like I want to show medium date format for dates those are five days before current date.
Comment #26
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.