How to resolved WARNING | Unescaped output detected of GrumPHP Magento 2.

When you use the GrumPHP code sniffer tool to commit your code for the project to follow the Magento Coding Standard.

GrumPHP is the Automatic Code Quality Checker tool for PHP-based applications.
Continue reading “How to resolved WARNING | Unescaped output detected of GrumPHP Magento 2.”

How to get Custom, Base URL in JS file Magento 2?

You can get the custom or base URL of the store in a javascript(JS) file for the frontend area using the 'mage/url' widgets.

You have to pass the 'mage/url' widget as a dependency in a define([]) or require([]) function of the javascript file. Continue reading “How to get Custom, Base URL in JS file Magento 2?”

How to set custom date format using Magento 2?

You can set Custom formatting of Date using Magento 2 by DateTimeFactory Class.

You just need to pass the custom format of the date in the gmtDate() function as per your requirement.

Many times, you need to set the Date format to a specific format, While you are working with third-party API you need to pass the Date as the specific format from Magento, in this situation you can use below code snippet below. Continue reading “How to set custom date format using Magento 2?”