Questions tagged [date]

A date is a reference to a particular day represented within a calendar system, and consists of year, month and day.

Filter by
Sorted by
Tagged with
1 vote
2 answers
96 views

How to set a date field in a ui form to be mandatory?

I have this date field in a form (a ui component) and i'm tryig to make it "required field", I tried with <item name="required-entry" xsi:type="boolean">true</...
elunicotomas's user avatar
0 votes
1 answer
128 views

cart price rule exact expiration date

Is there a way to get the exact cart price rule expiration date (the hour and minutes), I see that magento only stores the years, month, and day for to_date field.
Bob's user avatar
  • 11
0 votes
0 answers
22 views

How to add Multiple Delivery date and Timeline in ProductDetail page

In Magento 2.4, I need to add Multiple Delivery date and Timerange in Product Detail page. How to add this?
Saravanan DS's user avatar
  • 1,126
0 votes
1 answer
191 views

Magento 2: Customer account create Date of Birth field seprate dropdown

I have to add Date of Birth as a seprate dorpdown DD MM YYYY formate in customer account create form and my account section. I have implement dob.phtml and dob-validation-dropdown.js but not saving ...
Kirti Nariya's user avatar
  • 3,461
0 votes
1 answer
156 views

How to add Product Custom Options for specific Product?

In Magento 2.4, I need to add "Date", "Time" fields for only One Product - That is Belongs to a Separate "Attribute Set" Called "Services". How to add this ...
Saravanan DS's user avatar
  • 1,126
1 vote
2 answers
1k views

date format in admin form magento 2

In the db_schema : <column name="holidays_start_date" nullable="true" xsi:type="date" comment="holidays_start_date"/> I created a field of type date in ...
thomas poidevin's user avatar
0 votes
1 answer
626 views

Change Magento My Order 2.4.4 Date Format

I'm trying to change the date format from 3/6/22 to 03/06/2022 in this file: /app/code/Magento/Sales/view/frontend/templates/order/history.phtml https://i.stack.imgur.com/7cnCT.jpg How can I edit the ...
user3718303's user avatar
0 votes
3 answers
2k views

Custom Sorting option not working in Magetno 2.4 search

Custom Sorting option not working in Magetno 2.4 search app/code/Arun/NewSorting/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
Prits's user avatar
  • 626
0 votes
0 answers
511 views

Magento 2 Add Custom date filter in UI Grid

I have created a custom grid for my custom table. It has a created_at column. Now I want to filter the entries by 7 days, 30 days, 90 days. ie, a dropdown with options 7days, 30 days, 90 days. How do ...
Jancy Abraham's user avatar
1 vote
1 answer
799 views

Magento 2.4.2 invalid date format by default, can't change date format in UI component

I would like to specify the date format for a new date field in my CMS page form. I have created a new cms_page_form.xml field which links to a date field in the MySQL database table cms_page. However,...
drgandynt's user avatar
0 votes
1 answer
682 views

Magento 2 Admin Orders Date show not actual result

I have Magento 2.4.2-p1 EE. When i filter orders by dates, example: Purchase Date: 12/12/2021 - 12/12/2021 I have result with 777 found orders. But on last page i can see orders with wrong dates for ...
David Young's user avatar
0 votes
1 answer
405 views

Magento 2.4.x add datetime field in design configuration form using ui component

In Magento 2.4.x, How to add date time field in Content -> Design -> Config-> HtmlHead. I tried the below code it is showing in UI(design_config_form.xml) but it is not saving. <field ...
Saravanan DS's user avatar
  • 1,126
0 votes
1 answer
598 views

Magento2.3.4 different hours in REST API call GET Orders and the real order hour timezone

I have selected Timezone (Configuration->General->Locale Options) Central European Standard Time (Europe/Warsaw) Order 10004 has been created at: Sep 21, 2021, 5:59:34 PM When I send API ...
maya5510's user avatar
1 vote
0 answers
208 views

date range validation in magento 2 ui comonent

I have created a custom module to mark order as delivered , In my ui component file located at app/code/Namespace/Modulename/view/adminhtml/ui_component/namespace_delivery_form.xml i have the ...
Ritesh Kumar's user avatar
1 vote
3 answers
1k views

Magento 2 : Ui component displaying wrong date

So I created a module where I am storing order details in custom table and later on displaying all the details in custom grid. Everything is working fine except for date field. In the database its ...
Shivani Singh's user avatar
0 votes
1 answer
59 views

Converting this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in magento 2

How can we Convert this date format 2021-04-26 05:31:38 to 26 Apr, 2021 in Magento 2. Please let me know how can I do this.
Vibhore Jain's user avatar
0 votes
2 answers
1k views

Sort products by date Magento 2.4.1

$this->_collection->addAttributeToSort('created_at', 'DESC'); // not working $this->_collection->setOrder('created_at', 'DESC'); // not working //$this->_collection->setOrder('...
Andreja Vidovic's user avatar
0 votes
0 answers
70 views

Magento2 change time for datepicker

Currently, time for Holiday time picker is [from] => 2021-03-24 00:00:00 [to] => 2021-03-24 00:00:00 Need to change to [from] => 2021-03-24 00:00:00 [to] => 2021-03-24 23:59:59 The ...
Arjun's user avatar
  • 3,566
0 votes
4 answers
955 views

how to use date() in magento query?

I want to filter some orders based on the date range so in SQL i use this query SELECT * FROM `sales_order` WHERE date(created_at) >= '2020-12-02' AND (date( created_at) <= '2020-12-...
Friska Sianturi's user avatar
0 votes
2 answers
1k views

How to get date of tomorrow in magento2

How can I get date of tomorrow in Magento2? I can use below code to get current date but I couldn't fetch the date of tomorrow. // $this->datetime \Magento\Framework\Stdlib\DateTime\DateTime $...
VIPIN A ROY's user avatar
0 votes
1 answer
1k views

Magento 2.4 Sort products by date

I've found topics about enabling sorting by date, this being one example but on 2.4 this does not work, even manually typing ?product_list_order=created_at in url does not get any results, is there ...
James Ambardnishvili's user avatar
0 votes
1 answer
173 views

Change display month on select box

I have a module and a select box for display month. In file download.phtml, I mentionn value month and I want display that are 01, 02, 03, ..., 12. How can I do that?
namikaze's user avatar
1 vote
0 answers
22 views

M2 - Weird coupon date change on save

Magento version: 2.3.4 When I create a new shopping cart price rule (coupon code) and choose a date range like this: Then in the coupon overview list I see this date: So that correct, but when I ...
n00bly's user avatar
  • 623
0 votes
2 answers
834 views

Notice: A non well formed numeric value encountered

I'm trying to format the DB timestamp to 'm:d:y, something like 07/06/20`. Please change the piece of code below to help achieve it. echo $dbh->Record['fulfillmentDate']; Returns 2020-07-02 02:...
CodeForGood's user avatar
0 votes
1 answer
557 views

Count only business days, without weekend and holidays

I have the current date, in the format I need: Y/m/d And I need to calculate what date will be in X days excluding weekends and holidays. X - because this value is dynamic and can be set in the admin ...
David Young's user avatar
1 vote
1 answer
2k views

Magento 2.3 - Transactional email remove time from order date

How can we remove the time in the order created date inside the transactional email? We now load it like this; {{var created_at_formatted}} and displayed as: 9 apr. 2020 11:17:59 We want to remove ...
JGeer's user avatar
  • 1,416
1 vote
0 answers
372 views

Magento 2.3.4 Change date picker to 3 drop down dd/mm/yyyy

How to change Magento 2 date picker to 3 drop down which allows users to pick date month and year. Tried to follow this -> DOB Validation with three fields in magento2 But it didn't work and it wasn't ...
jibin george's user avatar
0 votes
1 answer
250 views

How to render date field in UI component (in php not xml) in magento 2

How to render date field in UI component(in php not xml) in magento 2 I am building form as in the catalog (meta arrays), datetime eav attributes. I have tried like below 'date_of_stock' => [ ...
Jaisa's user avatar
  • 2,596
0 votes
1 answer
365 views

magento 2.3 overide date calendar class

I am trying to override a date calendar class in Magento. But when I try doing it the date input from the product page disappears. Basic I want to override the date calendar script to add custom ...
Lasse Bang's user avatar
0 votes
0 answers
1k views

Importing Date Attributes in DD/MM/YYYY format

When importing products with date fields in format dd/mm/YYYY it throws this error: Value for 'special_to_date' attribute contains incorrect value in row(s): 1, 2, 3 From reading around I see ...
Johnny's user avatar
  • 1
0 votes
1 answer
1k views

convert any date into dateTimestamp in order to compare it

I’m trying to compare the current date timestamp with product special price end date. to get current date I use : $currentDate = Mage::getModel('core/date')->timestamp(time()); and for ...
Anass Hl's user avatar
0 votes
1 answer
2k views

How to put correct date on invoice PDF in Magento 2?

Invoice PDFs are generating the incorrect date, I have this on two sites both on 2.3.4 and en_GB locale e.g. $order->getCreatedAt() 2020-02-14 11:14:40 becomes $this->_localeDate->formatDate( ...
William Oakley's user avatar
2 votes
0 answers
62 views

Disable a dropdown based on Date attribute

I have created a 2 date attribute which is Date_from and Date_to via back-end. Admin can add these dates and related time slots in another drop-down attribute which is choose_date. In the frontend, ...
Aashik's user avatar
  • 31
0 votes
1 answer
922 views

Magento2 Order Date is Wrong in Admin Grid

We created an order in magento2 with API calls. It is working fine as expected . We have created_at field date as 23-01-2020 12:12:12 in database where as in admin magento2 order grid it is ...
purna gattu's user avatar
1 vote
0 answers
204 views

import date format correct in magento 2

i'm tring to import a date field correct into the special_from_date and special_to_date field of products however for some reason the result is not correct. I have this -<Item> <sku>...
marcel's user avatar
  • 21
1 vote
0 answers
61 views

Report interval date column issue - M2

Admin panel > Reports > Products > Ordered It's magento's default report and result data is showing in 3rd date it's actually of 4th date. Issue is, Data is showing in one day previous in grid. ...
Jimit Bhavsar's user avatar
1 vote
1 answer
530 views

Magento 2.3 get current local time in phtml

I want to load the current local time in a custom phtml file, that I want to load in my CMS Page. I currently have the following code but that loads the GMC time, not my local time. How can I change ...
JGeer's user avatar
  • 1,416
1 vote
1 answer
1k views

Magento 1.9 - How to get shipped date and display on Customer account My Order?

Backend generate date when we shipped order, Frontend shown only order created dated, Is it possible using event-observer?
zus's user avatar
  • 155
1 vote
0 answers
384 views

Magento 2 get current time and week days

I use the following code in my Magento 1 store, but I want to convert it to Magento 2. I load this in a custom .phtml file to display on a CMS page. How can rewrite the following for Magento 2? CODE:...
JGeer's user avatar
  • 1,416
0 votes
1 answer
250 views

Date format issue to save giftcard Lifetime in Magento 2

I am creating giftcard code programmatically. For this in vendor GiftCardAccount Module, the code is: $model = $this->giftCAFactory->create()->setStatus( \Magento\GiftCardAccount\...
Ajwad Syed's user avatar
  • 1,591
1 vote
1 answer
400 views

Date format missing in admin grid and admin form in magento 2 custom module?

I created a custom module to update news and stories to magento 2 website.I have the date field in my form( main.php ). $dateFormat = $this->_localeDate->getDateFormat( \...
Mujahidh's user avatar
  • 2,791
1 vote
1 answer
167 views

Store time in js

I need to use current store timestamp in js or phtml file, how can always have current store date-time or timestamp when phtml is cached and I cannot pass this variable to js. Any help will be very ...
Petro Chaikivskyi's user avatar
1 vote
0 answers
388 views

JSON Serialize DateTime in Web API

A lot of my Web API interfaces use DateTime return types or parameters as follows. interface TestInterface { /** * @param \DateTime $value * @return void */ public function ...
zingix's user avatar
  • 11
3 votes
2 answers
1k views

Magento 2 - Admin grid and export use different timezone

I'm using Magento 2. So, I created a Adminhtml data grid in a custom module. The problem is that the data grid doesn't match the exported data. I've set the timezone, but it seems data grid and ...
user7414328's user avatar
1 vote
2 answers
3k views

Change order date to invoice date on invoice PDF in Magento 2

How to change the order date in the invoice PDF in Magento 2 to invoice date? I think it's done in the AbstractPdf.php file, but cannot get the right code to pull the right data. It's shown in the ...
user82595's user avatar
2 votes
2 answers
775 views

How to over ride php file in magento 2.3

I want to do some changes in vendor/magento/framework/Stdlib/DateTime/Date.php How can I override the file in app folder?
Nafsss's user avatar
  • 760
2 votes
3 answers
440 views

M2 - Change end date of all coupon codes

In the database there is a table called salesrule_coupon which has all the coupon codes in it. I need to change the column expiration_date for all the coupons to the same date 30-08-2024, Is This ...
n00bly's user avatar
  • 623
1 vote
2 answers
2k views

M2 | How to configure store's timezone to set date as I am getting wrong date in magento?

I get different date from todays date. I tried below ways and all give difference in time: 1) \Magento\Catalog\Block\Product\Context $contexts, .......... .......... $this->...
Ajwad Syed's user avatar
  • 1,591
1 vote
1 answer
909 views

Get current date and time in custom module and save that in database in magento 2

I wanted to get the current date and time as created_at. I have tried all the ways I found on google but nothing works for me. It showing error while running my module. use Magento\Framework\View\...
neomai's user avatar
  • 23
1 vote
0 answers
45 views

Magento 2 warning on select date on frontend

Does anyone encounter this warning when choosing a date, please help me fix it. thank you.
MichaelHa's user avatar
  • 661

1
2 3 4 5