This module allows you to store a single date in the database, while displaying any offset of that date to your users. Rather than needing extra date fields to store/display this information, you can simply apply the display format and specify your desired offset for a stored date.

Use this module in the same way you would any other formatting module.

Project Page: https://www.drupal.org/sandbox/nlatoni/2444415

Setting up repository for the first time

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/nlatoni/2444415.git date_period_offset
cd date_period_offset

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxnlatoni2444415git

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.

davidsheart02’s picture

Status: Needs work » Needs review

I've resolved all errors reported by automated review tools. Ready for another review.

saurabh.tripathi.cs’s picture

Hi ,
I tried to clone this on my local. It is asking for password and not getting authenticated by my drupal.org password.
Issue:
saurabh@saurabh:~$ git clone --branch 7.x-1.x nlatoni@git.drupal.org:sandbox/nlatoni/2444415.git offset_date
Cloning into 'offset_date'...
nlatoni@git.drupal.org's password:
Permission denied, please try again.
fatal: Could not read from remote repository.

Please ensure you have given correct git repository link.Follow instructions:
You can find the correct git clone command for your sandbox by clicking on the Version control tab, removing the checkbox in front of "Maintainer", and clicking Show. You can then copy-paste the git clone command from the codeblock below "Setting up repository for the first time".

Reference : https://www.drupal.org/node/1011698.

davidsheart02’s picture

Issue summary: View changes

Updated to include correct git clone command

mlmoseley’s picture

First off, I'm not seeing a formatter in 'Manage Display, ' so the module is not working for me.

Individual user account
Yes

No duplication
Yes

Master Branch
Yes

Licensing
No. The GNU public license is not included.

3rd party assets/code
Yes

README.txt/README.md
No. The readme does not sufficiently explain how to use the module and does not follow the guidelines for README's. Explain specifically how to use the module. See the readme template here: https://www.drupal.org/node/2181737

Code long/complex enough for review
No. It has only four function definitions and the guidelines call for five, but I'm not sure if this is a hard and fast rule. Read the guidelines here: https://groups.drupal.org/node/195848

Secure code
Yes

Coding style & Drupal API usage
It looks good to me, except that the module doesn't work. And it passes coder review.

davidsheart02’s picture

@mlmoseley Thank you for your review. I'm surprised by your comment that the module doesn't work for you. I assume you downloaded and enabled the module just like any other drupal module. Did you then go to a content type containing a date field and manage that field's display? At that point you would see the "Offset Date" option in the drop down menu. You will not see it if you are not looking at a date field. Hence the requirement for the date module.

Could you be more specific about the steps you took to test this?

mlmoseley’s picture

Take a look at this video clip of my setup, and tell me if I'm using the module incorrectly or looking in the wrong place. Note: I'm using PHP 5.3.2, which is supported in D7, but which is older, and that may be the problem..

https://dl.dropboxusercontent.com/u/49576796/offset.mov

davidsheart02’s picture

@mlmoseley Thanks for testing. I'm not exactly sure what I'm looking at in your video, but I did uncover some things that weren't working correctly. I've updated the module and am ready for more testing to occur.

mlmoseley’s picture

What you're looking at is me showing you the module is enabled, and then showing you that no controls for off-setting the date appear near the 'Manage Display' field for a date field.

As to how I configured the site, I created a standard D7 site using drush, installed your module and it's dependencies, added a date field to a content type, and then looked for the offset UI in the 'Manage Display' field for that date field, and did not see it.

jasonrichardsmith@gmail.com’s picture

I have just tested this module. The field formatter is listed as an option and it appears to work as expected.

jasonrichardsmith@gmail.com’s picture

I would move this to RTBC, but I work with Nathaniel and coached him one writing the module, so I feel that would be unethical.

stefan.r’s picture

Title: D7 Offset Date » [D7] Offset Date
Status: Needs review » Needs work

Other than the remarks below this is RTBC as far as I am concerned.

Automated Review

Review of the 7.x-1.x branch (commit c525005):

Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

FILE: /var/www/drupal-7-pareview/pareview_temp/offset_date.module
---------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------
88 | WARNING | Only string literals should be passed to t() where
| | possible
105 | ERROR | Expected "if (...) {\n"; found "if(...){\n"
---------------------------------------------------------------------------

FILE: /var/www/drupal-7-pareview/pareview_temp/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
24 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.

Nitpicks:

  1. Offset Date Display
    ------------------------

    4 dashes too much

  2. Please link to the module page and issue queue in the introduction
  3. Add an Installation section where you say this can be installed as any other module (see https://www.drupal.org/node/2181737)
  4. Whitespace at end of line on line 7
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements
Nitpicks:
  1. Consider sanitizing the default values in offset_date_field_formatter_settings_form(), in case malicious strings somehow end up there (though it may be sanitized already, check and see by hardcoding bad input in there)
Coding style & Drupal API usage
  1. This personal preference, but as this is a display field formatter for the date module, consider renaming it to something that starts with "date_", while being careful to prevent namespace clashes -- "date_offset" may be "dangerous" in case the date module uses a hook_offset_* :)
  2. (*) Don't do t($summary) -- see coding standards. Wrap the text in t() instead (ie. Date Offset by etc.), while being careful to sanitize the dynamic parts that come from the settings. See check_plain() etc.

This review uses the Project Application Review Template.

davidsheart02’s picture

Status: Needs work » Needs review

All review comments from https://www.drupal.org/node/2444455#comment-9738363 have been addressed. Thank you for the thorough review. Please move to RTBC if agreed that all issues have been addressed.

davidsheart02’s picture

Title: [D7] Offset Date » [D7] Date Period Offset
Issue summary: View changes
stefan.r’s picture

Status: Needs review » Reviewed & tested by the community

OK looks good. Consider getting a review bones so someone can do a final review!

davidsheart02’s picture

Thanks Stefan. Looking forward to seeing this released!

cweagans’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

davidsheart02’s picture

Thanks @cweagans!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.