If I set an expiry date for an entry I get an error on one of the last lines:

$timePicker.timepicker('setTime', Name of edit section as shown to the user*3600 + 00*60 + 00);

I've traced this back to craft/app/templates/_includes/forms/time.hml:39:

$timePicker.timepicker('setTime', {{ value|date('G') }}*3600 + {{ value|date('i') }}*60 + {{ value|date('s') }});

But I don't understand why value|date('G') returns Name of edit section as shown to the user instead of an integer.

Might also mention that this site uses Norwegian locale.

Error in console Line causing the error

  • I'm not sure I'm following. Are you getting that error when trying to set an expiration date through the edit entry page in the control panel? Are you trying to set it through JavaScript on a front-end edit entry template?
    – Brad Bell
    Jan 9, 2017 at 21:55
  • No I'm setting it the normal way by selecting a date from the drop down date selector. But once it's set, and the entry saved, we get the javascript error message.
    – KnutSv
    Jan 9, 2017 at 22:40
  • Where do you see that error... in your browser's console? Can you post a screenshot (and if there is a stack trace leading up to it, that'd be helpful, too).
    – Brad Bell
    Jan 9, 2017 at 22:46
  • Added some screenshots.
    – KnutSv
    Jan 9, 2017 at 22:58
  • Whoa... weird. Are you doing any static translations, by chance? craftcms.com/support/static-translations
    – Brad Bell
    Jan 9, 2017 at 23:00

1 Answer 1


The issue here was an error in a translations file:

    'some key' => 'some value',
    'key missing value',   <== no value assigned to this key
    'other key' => 'other value value'
  • Wow... super-random, but nice find!
    – Brad Bell
    Jan 11, 2017 at 1:58

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.