0

I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

Whenever I go, within the Magento admin, to Content > Blocks, there is this error in the console: Uncaught TypeError: utils.convertToMomentFormat is not a function.

The file path is

myshop.com//pub/static/version1523976842/adminhtml/Magento/backend/en_US/Magento_Ui/js/form/element/date.js

The code:

prepareDateTimeFormats: function () {
  this.pickerDateTimeFormat = this.options.dateFormat;
  if (this.options.showsTime) {
   this.pickerDateTimeFormat += ' ' + this.options.timeFormat;
  }

  // This is the "problem" line
  this.pickerDateTimeFormat = utils.convertToMomentFormat(this.pickerDateTimeFormat);

  if (this.options.dateFormat) {
    this.outputDateFormat = this.options.dateFormat;
  }

  this.inputDateFormat = utils.convertToMomentFormat(this.inputDateFormat);
  this.outputDateFormat = utils.convertToMomentFormat(this.outputDateFormat);

  this.validationParams.dateFormat = this.outputDateFormat;
}

What is the cause of this error? How can I fix it?

0

I ran this command:

php bin/magento setup:static-content:deploy -f

and admin started to work again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.