[1.0.x] Current date and time

Created on 6 December 2023, 7 months ago
Updated 24 March 2024, 3 months ago

The Current Date and Time module allows administrators to display a dynamic date and time block on their Drupal site, showcasing the current date and time based on the selected country's timezone. Users can easily configure and customize the displayed time format, ensuring accurate and localized time information for a global audience.

Project link

https://www.drupal.org/project/current_date_time

📌 Task
Status

Needs work

Component

module

Created by

🇮🇳India SuyashArzare Indore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @SuyashArzare
  • 🇮🇳India vishal.kadam Mumbai

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • For the time this application is open, only your commits are allowed.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications , Application workflow , What to cover in an application review , and Tools to use for reviews .

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool only once per application.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues .

  • Issue was unassigned.
  • 🇮🇳India SuyashArzare Indore

    The Current Date and Time module allows administrators to display a dynamic date and time block on their Drupal site, showcasing the current date and time based on the selected country's timezone. Users can easily configure and customize the displayed time format, ensuring accurate and localized time information for a global audience.

    Project link

    https://www.drupal.org/project/current_date_time

  • 🇮🇳India AnokR

    Thank you for applying!

    Please fix PHPCS errors

    FILE: ...var/www/html/current_date_time/src/Services/TimestampService.php
    ----------------------------------------------------------------------
    FOUND 12 ERRORS AFFECTING 11 LINES
    ----------------------------------------------------------------------
      7 | ERROR | [x] Missing class doc comment
      8 | ERROR | [x] Opening brace should be on the same line as the
        |       |     declaration
     15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
        |       |     4
     23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
        |       |     4
     24 | ERROR | [x] Opening brace should be on the same line as the
        |       |     declaration
     25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
        |       |     8
     26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
        |       |     4
     41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
        |       |     4
     42 | ERROR | [x] Opening brace should be on the same line as the
        |       |     declaration
     43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
        |       |     8
     44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
        |       |     4
     44 | ERROR | [x] Expected 1 blank line after function; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    Time: 275ms; Memory: 8MB
    
    [Finished in 311ms]
    
    
    FILE: /var/www/html/current_date_time/src/Plugin/Block/ZoneBlock.php
    ----------------------------------------------------------------------
    FOUND 60 ERRORS AND 1 WARNING AFFECTING 59 LINES
    ----------------------------------------------------------------------
       8 | ERROR   | [x] Use statements should be sorted alphabetically.
         |         |     The first wrong one is
         |         |     Drupal\Core\Plugin\ContainerFactoryPluginInterface.
      21 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
      28 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      31 | ERROR   | [ ] More than 2 empty lines are not allowed
      43 | ERROR   | [x] There must be no blank lines after the function
         |         |     comment
      44 | ERROR   | [x] Whitespace found at end of line
      45 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      46 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
      47 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      48 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      49 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      54 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      55 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
      56 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      62 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      67 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      68 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
      69 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      70 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      71 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      72 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      73 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      75 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 6
      76 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      77 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      78 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      78 | WARNING | [ ] t() calls should be avoided in classes, use
         |         |     \Drupal\Core\StringTranslation\StringTranslationTrait
         |         |     and $this->t() instead
      79 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      80 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      82 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      83 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      84 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
      87 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      88 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      93 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
      94 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
      95 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      96 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      97 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      98 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
      99 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     100 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     101 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     103 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
     104 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     105 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     106 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     107 | ERROR   | [x] Array indentation error, expected 10 spaces but
         |         |     found 8
     109 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
     110 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
     115 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
     116 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
     117 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
     118 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
     119 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
     121 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
     121 | ERROR   | [x] Missing function doc comment
     122 | ERROR   | [x] Opening brace should be on the same line as the
         |         |     declaration
     123 | ERROR   | [x] Line indented incorrectly; expected 4 spaces,
         |         |     found 8
     124 | ERROR   | [x] Line indented incorrectly; expected 2 spaces,
         |         |     found 4
     125 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 59 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    Time: 288ms; Memory: 10MB
    
    [Finished in 330ms]
    
  • 🇮🇳India SuyashArzare Indore

    Thank you for checking the module!
    I had fixed PHPCS errors.

  • Status changed to Needs work 7 months ago
  • 🇫🇷France nikral

    Thanks for applying!
    I see two empty .gitkeep files, I don't know if this is really necessary.
    I think you can delete them
    - current_date_time/src/Plugin/.gitkeep
    - current_date_time/src/.gitkeep

  • 🇮🇳India SuyashArzare Indore

    Thank You for checking the module!
    I had deleted those two files, as of now it is not necessary in the module.

  • Status changed to Needs review 7 months ago
  • 🇮🇳India SuyashArzare Indore

    Let me know, if any other issues in module.

  • Status changed to Needs work 7 months ago
  • 🇮🇳India vishal.kadam Mumbai

    FILE: current_date_time.info.yml

    core_version_requirement: ^8 || ^9 || ^10

    The Drupal Core versions before 8.7.7 do not recognize the core_version_requirement: key.

  • Status changed to Needs review 7 months ago
  • 🇮🇳India SuyashArzare Indore

    Thanks for review!
    I have updated the .info file, please let me know if any other issues in module.

  • 🇲🇩Moldova andrei.vesterli Chisinau

    Hi @SuyashArzare

    Thx for your contribution! Good job and keep it up! I will leave some comments after the review:

    • Check this guide for more information on how to format the README
    • Check this guide for more information on how to provide a composer.json file in the project
    • I see that the service TimestampService has a public method, so, it's a best practice and a recommendation to provide an interface for that class for ex: TimestampServiceInterface and declare the public method getFormattedTimestamp
    • Do not use the {@inheritdoc} for the TimestampService service as it's not inherited. Please, provide a relevant description like: "The timestamp service class implementation."
    • For the protected properties it's a recommendation to indicate the type: protected DateFormatterInterface $dateFormatter;. Same question for the UserBlock class and the properties inside.
    • Update the method getFormattedTimestamp by adding the missing doxy, fox ex: public function getFormattedTimestamp(int $timestamp, string $format, string $timezone): string
    • The plugin class UserBlock. Replace the REQUEST_TIME with the \Drupal::time()->getRequestTime() but, use the dependency injection for \Drupal::time(). Check this post for more information.
    • The plugin class UserBlock. has the method getCacheMaxAge. Do you need it? And then it returns 10?
  • Status changed to Needs work 6 months ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am changing priority as per Issue priorities .

Production build 0.69.0 2024