Skip to content

Conversation

@marcorensch
Copy link
Contributor

@marcorensch marcorensch commented Nov 4, 2025

User description

and added (copied) the content from the old manual about JDate. 99% has been taken from the old page (https://docs.joomla.org/How_to_use_JDate).


PR Type

Documentation


Description

  • Added new documentation section for Joomla's Date class

  • Included comprehensive guide on Date class usage and methods

  • Created index page for helper classes documentation

  • Documented date formatting and timezone handling


Diagram Walkthrough

flowchart LR
  A["Documentation"] --> B["Date Class Guide"]
  A --> C["Classes Index"]
  B --> D["Date Creation"]
  B --> E["Date Formatting"]
  B --> F["Date Operations"]
  B --> G["Date Conversions"]
Loading

File Walkthrough

Relevant files
Documentation
date.md
Date Class Documentation                                                                 

docs/general-concepts/classes/date.md

  • Added comprehensive documentation for Joomla's Date class
  • Included code examples for date creation and manipulation
  • Documented date formatting methods and timezone handling
  • Added examples for date operations and conversions
+208/-0 
index.md
Classes Index Page                                                                             

docs/general-concepts/classes/index.md

  • Created new index page for helper classes documentation
  • Added basic overview of helper classes section
  • Established foundation for future class documentation
+8/-0     

@qodo-merge-pro qodo-merge-pro bot changed the title Added (Helper) Classes section Added (Helper) Classes section Nov 4, 2025
@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Nov 4, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Nov 4, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix incorrect date examples and comments
Suggestion Impact:The commit corrected one of the inaccurate examples by fixing the combined time string to include "+23 seconds". However, it did not rename the redeclared $plusTimeToTime variable or fix its comment at that location; those issues persist elsewhere in the updated sections as well.

code diff:

@@ -55,29 +166,233 @@
 $plus1YearAnd1MonthTime = new Date('now +1 year +1 month'); // Current date and time, + 1 year and 1 month.
 $plusTimeToTime = new Date('now +1 hour +30 minutes +3 seconds'); // Current date and time, + 1 hour, 30 minutes and 3 seconds
 $plusTimeToTime = new Date('now -1 hour +30 minutes +3 seconds'); // Current date and time, + 1 hour, 30 minutes and 3 seconds
-$combinedTimeToTime = new Date('now -1 hour -30 minutes 23 seconds'); // Current date and time, - 1 hour, +30 minutes and +23 seconds
+$combinedTimeToTime = new Date('now -1 hour -30 minutes +23 seconds'); // Current date and time, - 1 hour, +30 minutes and +23 seconds
 
 $date = new Date('2025-12-1 15:20:00'); // 3:20 PM, December 1st, 2025
-```

Correct the variable redeclaration and inaccurate comments in the Date object
creation examples to ensure they are clear and correct.

docs/general-concepts/classes/date.md [56-58]

 $plusTimeToTime = new Date('now +1 hour +30 minutes +3 seconds'); // Current date and time, + 1 hour, 30 minutes and 3 seconds
-$plusTimeToTime = new Date('now -1 hour +30 minutes +3 seconds'); // Current date and time, + 1 hour, 30 minutes and 3 seconds
-$combinedTimeToTime = new Date('now -1 hour -30 minutes 23 seconds'); // Current date and time, - 1 hour, +30 minutes and +23 seconds
+$minusPlusTimeToTime = new Date('now -1 hour +30 minutes +3 seconds'); // Current date and time, - 1 hour, +30 minutes and +3 seconds
+$combinedTimeToTime = new Date('now -1 hour -30 minutes +23 seconds'); // Current date and time, - 1 hour, -30 minutes and +23 seconds

[Suggestion processed]

Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies multiple copy-paste errors in the documentation's code examples, including a redeclared variable and comments that contradict the code, which improves accuracy and prevents confusion.

Low
Correct the day in RFC822 example
Suggestion Impact:The commit updated the RFC 822 example to show "Mon" instead of "Sat" for December 1, 2025.

code diff:

+### Outputting Dates in RFC 822 Format
+
+```php
+$date = new Date('2025-12-1 15:20:00');
+$rfcDate = $date->toRFC822(); // Mon, 01 Dec 2025 15:20:00 +0000
+```
+

Correct the day of the week in the toRFC822() example output from 'Sat' to 'Mon'
to match the date 'December 1st, 2025'.

docs/general-concepts/classes/date.md [193]

-$date->toRFC822(); // Sat, 01 Dec 2025 15:20:00 +0000
+$date->toRFC822(); // Mon, 01 Dec 2025 15:20:00 +0000

[Suggestion processed]

Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies a factual error in an example output within the documentation, improving its accuracy and preventing potential developer confusion.

Low
  • Update

@HLeithner
Copy link
Member

Hi @marcorensch

thanks for your pr, I would like the opportunity not just copy the old documentation instead make it more use full.

For example the usage of base Date class is pretty good explained on the php manual it self https://www.php.net/manual/de/class.datetime.php

The getInstance is pretty use less and should be removed since it's no difference to new Date() but it's not touched for b/c reasons, I may would mark it as legacy code.

The examples how to use the class misses the most important features

  • DAY_ABBR - \D
  • DAY_NAME - \l
  • MONTH_ABBR - \M
  • MONTH_NAME - \F

The best way to create the date object is only mentioned but not explained, Factory::getDate();

The available dynamic properties need to be listed and explained (found in __get method).

The HtmlHelper explaination starts with a useless sentence and doesn't explain anything,

I would understand if you can't or would not like to do the changes but it would be really great if you can do it.

@marcorensch
Copy link
Contributor Author

Hi @marcorensch

thanks for your pr, I would like the opportunity not just copy the old documentation instead make it more use full.

For example the usage of base Date class is pretty good explained on the php manual it self https://www.php.net/manual/de/class.datetime.php

The getInstance is pretty use less and should be removed since it's no difference to new Date() but it's not touched for b/c reasons, I may would mark it as legacy code.

The examples how to use the class misses the most important features

* DAY_ABBR - `\D`

* DAY_NAME - `\l`

* MONTH_ABBR - `\M`

* MONTH_NAME - `\F`

The best way to create the date object is only mentioned but not explained, Factory::getDate();

The available dynamic properties need to be listed and explained (found in __get method).

The HtmlHelper explaination starts with a useless sentence and doesn't explain anything,

I would understand if you can't or would not like to do the changes but it would be really great if you can do it.

I will have a look into it - no big deal

@marcorensch
Copy link
Contributor Author

@HLeithner > I think I need to stop now... but I think its covered yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants