Skip to content

Conversation

@hostep
Copy link
Contributor

@hostep hostep commented Jul 24, 2024

…rmat and adding timezone at the end.

Description (*)

When an error message is outputted to the js console, it displays a timestamp in front of it.
For example:
Screenshot 2024-07-24 at 19 44 48

One of the problems I'm noticing with this, is that it shows the time in 12 hour format, which means that if you work in the evening, it will look like a time in the morning. I know this is an European thing, but even in the USA, there was no am/pm output, so over there you also have no idea if the time was before or after the noon.

Also additionally, I think it's useful to also add the timezone to this timestamp. In case you have some visitor taking screenshots of the console, you have some idea of when exactly the problem happened, and having the correct timezone will help with that.

Related Pull Requests

N/A

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Wait until after the noon
  2. Manually introduce a bug in the code: open the file app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js and add this problematic line:
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
@@ -13,6 +13,8 @@ define([
     'use strict';

     return Component.extend({
+        problem: window.unexistingProp.unexistingProp,
+
         /**
          * @param {*} price
          * @return {*|String}
  1. Have a Magento shop setup with at least one saleable product in the database
  2. On the frontend, put the product in your cart and go to the checkout
  3. Look at your browsers inspector

Before the changes, it outputs something like: [2024-07-24 07:43:24]
After the changes, it outputs something like: [2024-07-24 19:43:24+02:00]

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Improved date format in js console: switch from 12 hour to 24 hour fo… #38983: Improved date format in js console: switch from 12 hour to 24 hour fo…

@m2-assistant
Copy link

m2-assistant bot commented Jul 24, 2024

Hi @hostep. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@hostep
Copy link
Contributor Author

hostep commented Jul 24, 2024

@magento run all tests

@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 26, 2024
@engcom-Hotel
Copy link
Contributor

@magento create issue

@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jul 29, 2024
@engcom-November engcom-November self-assigned this Sep 19, 2024
@engcom-November
Copy link
Contributor

Thanks for the collaboration & contribution!

✔️ QA Passed

Steps to reproduce:

  1. Wait until after the noon
    Manually introduce a bug in the code: open the file app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js and add this problematic line:
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
@@ -13,6 +13,8 @@ define([
     'use strict';

     return Component.extend({
+        problem: window.unexistingProp.unexistingProp,
+
         /**
          * @param {*} price
          * @return {*|String}
  1. Have a Magento shop setup with at least one saleable product in the database
  2. On the frontend, put the product in your cart and go to the checkout
  3. Look at your browsers inspector

Before: ✖️ 

image

After: ✔️

image

Since there are build failures moving this to Extended testing.

@engcom-Dash
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@engcom-Dash
Copy link
Contributor

@magento run Functional Tests B2B

@engcom-Dash
Copy link
Contributor

@magento run all tests

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit daaa4b3 into magento:2.4-develop Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for testing Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Projects

Status: Recently Merged

Development

Successfully merging this pull request may close these issues.

[Issue] Improved date format in js console: switch from 12 hour to 24 hour fo…

7 participants