Time Range

A Time Range Widget for Drupal 8

Installation

  1. Extract this module into your modules folder.
  2. Flush the Cache.
  3. Enable the Time Range module.
  4. Create a Date Range field, select Day and time as field type.
  5. To select Time range, go to your content type's form display settings and select Time Range

This is just a change to the display form, so that the user doesn't need to enter too much content.
The storage of time is provided by the core.
Because it doesn't require you to fill out the date, the default record is the date of the day.
If you don't want to see the date time, go to your content type's display settings and change the Date/time format in your style.

Home page:
https://www.drupal.org/project/time_range

Cloning the repository:

git clone --branch 8.x-1.x git://git.drupal.org/project/time_range.git
cd time_range

Sandbox:
https://duje2.ply.st/admin/structure/types/manage/article/form-display

Please reviews.
Thanks

Comments

dravenk created an issue. See original summary.

PA robot’s picture

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.

ruchi-94’s picture

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. Time: 92ms; Memory: 4Mb

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

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
No: Does not follow the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. code is optimized

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

ruchi-94’s picture

vitaliiishchenko’s picture

Hi, dravenk.
I installed the module and used it for a little time. It works fine for me.

Deepthi kumari’s picture

Status: Needs review » Needs work

Hi,

The module is working fine. Found below minor issues in phpcs.

FILE: ...trib\time_range\src\Plugin\Field\FieldWidget\TimeRangeWidget.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...\time_range\src\Plugin\Field\FieldWidget\TimeRangeWidgetBase.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...modules\contrib\time_range\time_range.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but
   |       |     found "\r\n"
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Everything else looks fine.

dravenk’s picture

@Detal
I am very glad to hear that you are using this module.

dravenk’s picture

Status: Needs work » Needs review

Thanks for review.but, I use the phpcs/phpcbf check time_range not found fixable.Run on d8.5. See below:

$ phpcbf --standard=core/phpcs.xml --report=diff -vv  modules/contrib/time_range
Changing into directory /***/modules/contrib/time_range
Processing time_range.module [PHP => 98 tokens in 21 lines]... DONE in 7ms (0 fixable violations)
Changing into directory /***/modules/contrib/time_range/src/Plugin/Field/FieldWidget
Processing TimeRangeWidgetBase.php [PHP => 364 tokens in 42 lines]... DONE in 23ms (0 fixable violations)
Processing TimeRangeWidget.php [PHP => 591 tokens in 84 lines]... DONE in 39ms (0 fixable violations)
No fixable errors were found
Time: 119ms; Memory: 6Mb

Make sure you check on the last commit? Correct me if I'm wrong.The last commit was write down here:

commit 01534434a744047075432b90033745ad0cc54f3d (HEAD -> 8.x-1.x, origin/HEAD, origin/8.x-1.x, composer/8.x-1.x)
Author: DravenK <longxianwen@live.cn>
Date:   Sun Dec 10 02:57:50 2017 +0800

    That perfect adherence to Drupal Coding Standard
dravenk’s picture

Use the phpcbf --standard=Drupal time_range check again.
Update summary.

pvsureshmca’s picture

Status: Needs review » Needs work
StatusFileSize
new46.4 KB

Hi,

please refer the pareview.sh report below.

FILE: /root/repos/pareviewsh/pareview_temp/README.md
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
27 | ERROR | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 70ms; Memory: 6Mb
pvsureshmca’s picture

Hi,

This module is working fine for me Apart from the above issue report. Please refer the attached image for more reference.

Thanks for your contribution.

dravenk’s picture

Status: Needs work » Needs review

@pvsureshmca
Thanks attentive. Now, fixed the space line.

lawxen’s picture

Status: Needs review » Reviewed & tested by the community

This module just has a widget hook, so no security risk on my opinion

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.

I thank all the dedicated reviewers as well.

avpaderno’s picture

Status: Fixed » Closed (fixed)

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