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


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?

1 Answer 1


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 and acknowledge you have read our privacy policy.

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