Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix admin localized date formatting #27311

Closed
Closed
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8ea463c
Fix admin localized date formatting
Mar 17, 2020
238afa6
Clean up and add doc
Mar 17, 2020
27b195b
Remove unused code block
Mar 17, 2020
e76594f
[MFTF] Add ActionGroup AdminCreateCartPriceRuleWithFromDateActionGroup
Mar 18, 2020
5394592
[MFTF] Add ability to create localized admin user
Mar 18, 2020
7172c03
[MFTF] Add test to verify GITHUB_27311
Mar 18, 2020
61d28a9
[MFTF] Split up test and add some cleaning
Mar 18, 2020
765c315
Remove @inheritedDoc from js docblock
Apr 8, 2020
82d3dad
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
Apr 8, 2020
6894965
Merge branch '2.4-develop' of github.com:magento/magento2 into fix_ad…
May 6, 2020
1e09ee1
Merge branch '2.4-develop' of github.com:magento/magento2 into fix_ad…
May 19, 2020
c2f608c
Merge branch '2.4-develop' of github.com:magento/magento2 into fix_ad…
May 26, 2020
2c393dd
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
Jul 15, 2020
b50aaaf
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
engcom-Charlie Aug 5, 2020
77e4847
Update Test Case ID
lbajsarowicz Aug 11, 2020
d71f5e5
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
engcom-Charlie Aug 13, 2020
4ae428a
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
engcom-Charlie Aug 26, 2020
d00ec4d
Use AdminLoginActionGroup instead of LoginAsAdmin
Oct 23, 2020
02d8c5d
Use AdminLoginActionGroup instead of LoginAsAdmin
Oct 23, 2020
f860252
Use AdminLoginActionGroup instead of LoginAsAdmin
Oct 23, 2020
0ea9593
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
Nov 12, 2020
508bbcd
Merge remote-tracking branch 'origin/fix_admin_localized_date_formatt…
Nov 12, 2020
7f094af
Fix tests and UI date filter
Nov 12, 2020
d6a1ba5
Merge branch '2.4-develop' into fix_admin_localized_date_formatting
Jan 18, 2021
921a1fc
Moment.js strict mode
Jan 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/code/Magento/Ui/view/base/web/js/form/element/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,19 @@ define([
* Prepares and sets date/time value that will be displayed
* in the input field.
*
* @param {String} value
* @inheritDoc
*/
onValueChange: function (value) {
var shiftedValue;
setInitialValue: function () {
const value = this.getInitialValue();
let shiftedValue;

if (value) {
if (this.options.showsTime) {
shiftedValue = moment.tz(value, 'UTC').tz(this.storeTimeZone);
} else {
shiftedValue = moment(value, this.outputDateFormat);
}

if (!shiftedValue.isValid()) {
shiftedValue = moment(value, this.inputDateFormat);
}

shiftedValue = shiftedValue.format(this.pickerDateTimeFormat);
} else {
shiftedValue = '';
Expand All @@ -141,6 +139,8 @@ define([
if (shiftedValue !== this.shiftedValue()) {
this.shiftedValue(shiftedValue);
}

return this._super();
},

/**
Expand Down