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
0
votes
1answer
158 views

Apply Date Filter With “not qual to” Condition in Magento 2

i need to filter with a date column with not current month records i tried : $start = date('Y-m-d'.' 23:59:59',strtotime('-45 days')); $end = date('Y-m-d'.' 00:00:00'); $collection =...
0
votes
3answers
621 views

How can i add date and month text box with validation(No calender)

How can I add Magento custom validation for month and date text box? These two are input text box user can enter the number and I have to validate it via custom validation. Don't want a calender. <...
0
votes
0answers
272 views

How can i only show date and month select box in calender(Magento 2)

I want my customer edit form calendar to be only date and month and no year and no week days name. This must include leap year as well if a user birthday is on 29th Feb and according to this current ...
0
votes
0answers
169 views

how to change getDateFormat() to only have date and month

So in my Customer edit form, I need to remove year , so on inspecting i found out the script code renders from vendor/magento/framework/View/Element/Html/Date.php code $html .= '<script type="...
0
votes
1answer
254 views

Magento 2 Fatal error when adding date field in admin form and save

I am developing a custom module where there are many fields text,select,multiselect..etc in admin form. Today I have added one field in admin of type time ,below is the code to add new field $...
0
votes
1answer
508 views

Magento 2: Admin Order Date filter showing wrong result

I have been trying to filter admin order based on a date but getting the wrong result. I have try to filter Purchase Date from: 03-03-2019 and to: 03-03-2019 Expected result: Filter result list ...
2
votes
1answer
73 views

Magento Frontend form date picker today date is wrong

I want to setup date picker in frontend form, and I did this currently, datepicker is shown in a frontend form only one issue is that when I click on today in datepicker it take the wrong date ...
0
votes
2answers
638 views

Model setData dateTime field set current date

I have an extension attribute for a dateTime field in sales_order table. What I want to do on a certain action is to set the value of this field to NOW(). How can I perform this? $order->setData(...
1
vote
0answers
229 views

Magento 2 Ui Component Date Field Saves current date

Magento 2 Ui component Date Fields save the current date not saved the inputed date please show my below code Form <field name="active_from_date" formElement="date"> <argument name=...
0
votes
0answers
186 views

Schedule CMS block content change on a specific date

We have a CMS block on our front page and we would like to automatically change the content of it on Black Friday, for example. How could we do this?
0
votes
1answer
92 views

setCreatedAt Is not working

From the following script below, I dynamically add evaluations on the products, however I am not able to set the creation date from $review->setCreatedAt($data_avaliacao);. I already researched the ...
0
votes
1answer
512 views

Magento2 set timezone with mysql query

I am trying to get days difference between 2 dates with mysql query with DATEDIFF function for production_days column: $collection->getSelect()->joinLeft(array('cvo' => 'cp_vendor_order'), "...
1
vote
0answers
30 views

How to disable previous date for custom attribute in magento 2?

Step 1 : Add below input field whereever you need in .phtml file <div class="field street"> <label for="date_field" class="label"><span><?= /* @escapeNotVerified */ __(...
0
votes
1answer
1k views

Magento 2 how to remove special price if special price date has expired

I am facing issue in Magento 2.1.7 If special price date has expired for any products , i want to remove special price and special price to date and special price from date form products, by using ...
0
votes
1answer
4k views

Special Price From Date and Special Price To Date not visible in backend M2

I am working on Magento Enterprise 2.2.5, I want to set special price for some products but Special Price From Date and Special Price To Date is not visible. Can someone have idea how we can add these ...
2
votes
1answer
1k views

Magento2: Add date-from validation for dob (date of birth) field in customer creation

I want to limit the dob field in account creation form to be not less than 01/01/1900. I thought 2 way: - limit the calendar widget (but maybe someone could input the date directly) - add a ...
0
votes
0answers
33 views

Magento 2 How to add Delivery date function in both admin and frontend

In magento 2 I need to add Delivery date option in both frontend page and admin page. Is it possible to update by the code?
0
votes
0answers
80 views

date of birth value doesn't show up in account information in admin panel on magento 1.9

I am trying to fetch the date of birth of end user but i show there no date of birth enter or saved in admin. <div class="dob-full" style="display:none;"> <input type="hidden" id="<?...
2
votes
0answers
60 views

Magento : How to Solve Fatal Error SetDateRange() [closed]

When I try to filtering report by date range in admin, It show me error like this. Fatal error: Call to a member function setDateRange() on boolean in app/code/core/Mage/Reports/Model/Report.php ...
0
votes
1answer
31 views

The custom function is returning error when added in a controller

I have a custom function in a controller file, the function basically is to be used for converting the time into a different custom format, for example, if the time is indicating the date of yesterday,...
1
vote
2answers
6k views

Magento 2.2.3 How to adjust date format?

The following piece of code: <?= $post->getCreatedAt() ?> Returns the following output: 2018-04-13 11:53:00 How to adjust that piece of code in a way that the output would be something ...
0
votes
1answer
908 views

Convert Datetime to Date

I am having trouble pulling the date out of a datetime in magento. Currently the date gets called using: $_formatDate = Mage::app()->getLocale()->getDateTimeFormat( ...
2
votes
1answer
3k views

How do I change date picker format for admin date field

How can I change the date format to display as dd/mm/yyyy for admin date field? Currently it is displaying as mm/dd/yyyy format. Can you please help me out?
1
vote
2answers
801 views

Collection filter date range not working

I tried to find the collection that has a range created between 4 hours, but somehow it doesnt show the right collection size, it always returns '0', here's how i use the filter: $to = date('Y-m-d H:...
1
vote
2answers
319 views

Changing Date in Magento 2

How can I change the date in magento 2? Not the format, but the date. For example, I want to post some article with the date of a week ago, like 20 march. How can I do this? I have searched for it ...
0
votes
1answer
121 views

How add current date and text

Need to add today date and 2020096 in 'number' => $consignmentNo, so it will be 201803222020096$consignmentNo $tracks = array( '1'=>array( 'carrier_code' => $carrier_code, ...
1
vote
1answer
114 views

Adding future date/time to TrustPilot script in Magento Packing Slip

I am about to add a "Structured Data Snippet" to my Magento packing slip emails, which should include a future date. The snippet looks like this (example data): <script type="application/json+...
1
vote
1answer
139 views

How to get CMS block ids between dates?

Going forward with my customization I would like to get CMS blocks using a filter: My code to get the collection: $today = Mage::getModel( 'core/date' )->date( "Y-m-d" ); $collection = ...
0
votes
1answer
827 views

Magento 2.1 How to change member birthday date format

By default the date format is mm/dd/yyyy when new member register. How can I change the date format of birthday field to dd/mm/yyyy? I have tried to change locale to EN_UK, EN Canada, and also ...
0
votes
1answer
38 views

Change layout var date email

Inside a transactional email whe print a date attribute, using the following code: {{var quote.followup}} This only displays the date as 2017-12-11 00:00:00 How can I change that into Mondag 11 ...
3
votes
2answers
2k views

Add Custom Product Grid Created Date And Created By Magento 2

In magento 2 admin panel, at product list grid area, i want to add one more grid with date, that date define product create date. so we get idea at which time product was created. And i also want to ...
1
vote
2answers
69 views

Magento display date into multi values

I load the following code: <?php if (isset($item['delivery_eta'])): ?> <?php $date = DateTime::createFromFormat('m-d-Y', $item['delivery_eta']); if (!$date) { $date = DateTime::...
4
votes
1answer
5k views

Date field system.xml

I wonder what 'date' type needs in system.xml. I keep getting the error : system.xml (only the field): <field id="date" translate="label" type="date" sortOrder="2" showInDefault="1" showInWebsite=...
0
votes
1answer
189 views

php date always displayed in Dutch [duplicate]

I currently use the following code to display some date inside my Magento store: setlocale(LC_TIME, 'nl_NL'); $today = new Zend_Date($_product->getData('delivery_eta'), 'MM-dd-yyyy'); $date = ...
1
vote
1answer
910 views

Set Product as New from Date - Reverts to random date in past after clicking out of product edit

We have an issue with using New From Date as filter in product grid Steps - on admin go to products > catalog - in columns make sure you have 'set product as new from date' selected - in filters ...
1
vote
3answers
3k views

Converting a locale date to YYYY-MM-DD

I have a datepicker in my site which formats the time in the current locale. So the time gets sent to the server in d/MM/yy-format. The locale on the frontend is determined by Magento\Framework\...
0
votes
2answers
396 views

one month previous day in magento

I want new date from current date, difference of 30 days. $dt = date("Y/m/j",strtotime("-1 month")); and $firstDayOfPrevMonth = date("01.m.Y", Mage::getModel('core/date')->timestamp(strtotime('...
1
vote
0answers
108 views

Magento 2: Send email based on timezone selected by customer

I am developing extension in which I need to send email on base of selected Timezone by the customer. I have set a cron which is working fine, however, I confused about to send email on the base of ...
3
votes
1answer
3k views

How to change date format for Order Invoices In Magento 2

I want to change the date format for admin in Sales->Order(view order)->Invoices tab in 24H format I tried to find how this grid is rendered and i found(with template path hinth) that this table is ...
0
votes
2answers
899 views

How to get Subscriber based on from date in Magento 1.9?

I am able to get all subscriber but there is no date filter in Magento for subscribers. Can anyone tell me how to get subscriber based on date in magento?
2
votes
0answers
388 views

Date Formatting Options - getCreatedAtFormatter($format)

The new order transactional email template passes in the number "2" and creates the format including the time. I wish to display just the Date. I would like to know what the different format options ...
2
votes
1answer
495 views

Magento : Catalog Price Rule Date Not Working Properly

I want to give some discounts for some products. Discount should start from a certain date, let's say 20/04/2017. This date is working fine if I use special price field in product management. But ...
3
votes
3answers
3k views

Magento 2: Filter Field with Date Issue

I have below code $updatedAtFrom = date("Y-m-d",strtotime($updatedAt['orig_from'])); $updatedAtTo = date("Y-m-d",strtotime($updatedAt['orig_to'])); $this->getCollection()->addFieldToFilter('...
2
votes
0answers
861 views

How to change date format for backend in Magento 2 [duplicate]

On Order-Sales tab we have Filters. Here we have Purchase Date which it's a date picker, and by default, the date format it's mm/dd/yy. I want to make this date filed to be dd/mm/yy but i can't ...
1
vote
3answers
1k views

Product collection based on “Set Product as New from Date”

I want product collection based on "Set Product as New from Date".I have specify date for filter this. Below is code : $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::...
0
votes
0answers
140 views

How to fix backend date always showing 2020?

I've looked far and wide for an answer to this problem and could not find one. Perhaps you can help. The Problem: In the Magento Admin Backend Panel, I am trying to set the Special Price Date so that ...
1
vote
1answer
351 views

Magento 1.9 remove time from order confirmation

In my order confirmation, I have this code echo Mage::helper('core')->formatDate($_order->getData('created_at'),Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true); and the output is Order ...
1
vote
0answers
802 views

Magento 2 : How to Add Date Validator on Custom Input Form Js File

I have created a custom input on the checkout page, I want to add date validator from js but I can't. I already tried this custom js: $( "#co-shipping-method-form" ).validate({ rules: { ...
2
votes
1answer
2k views

Magento : Filtering Date Issue on Custom Grid

This is my column code: $this->addColumn( Mage::getModel('catalog/product')->formatUrlKey($key), array( 'header' => Mage::helper('core')->__($label), 'index' =>...
1
vote
1answer
575 views

Call to a member function getId() on null date.phtml

I want to call a date.phtml template in catalog/product/view.phtml but i have the error: Call to a member function getId() on null in ...PATH line 28 and this line there is : <?php $_optionId = $...