Answers.Body: <p>The issue here was an error in a translations file:</p>
  
  <pre><code>array(
      'some key' =&gt; 'some value',
      'key missing value',   &lt;== no value assigned to this key
      'other key' =&gt; 'other value value'
  );
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-11T01:58:16.823Z
Answers.Text: Wow... super-random, but nice find!
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-10T09:47:00.197Z
Answers.LastActivityDate: 2017-01-10T09:47:00.197Z
Answers.UserDisplayName: KnutSv
Body: <p>If I set an expiry date for an entry I get an error on one of the last lines:</p>
  
  <pre><code>$timePicker.timepicker('setTime', Name of edit section as shown to the user*3600 + 00*60 + 00);
  </code></pre>
  
  <p>I've traced this back to <code>craft/app/templates/_includes/forms/time.hml:39</code>:</p>
  
  <pre><code>$timePicker.timepicker('setTime', {{ value|date('G') }}*3600 + {{ value|date('i') }}*60 + {{ value|date('s') }});
  </code></pre>
  
  <p>But I don't understand why <code>value|date('G')</code> returns <code>Name of edit section as shown to the user</code> instead of an integer.</p>
  
  <p>Might also mention that this site uses Norwegian locale.</p>
  
  <p><a href="https://i.sstatic.net/rWhub.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rWhub.png" alt="Error in console"></a>
  <a href="https://i.sstatic.net/KVuFJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KVuFJ.png" alt="Line causing the error"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-09T21:55:37.887Z
Comments.Text: 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?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-09T22:40:29.593Z
Comments.Text: 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.
Comments.UserDisplayName: KnutSv
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-09T22:46:46.933Z
Comments.Text: 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).
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-09T22:58:22.650Z
Comments.Text: Added some screenshots.
Comments.UserDisplayName: KnutSv
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-09T23:00:59.933Z
Comments.Text: Whoa... weird.  Are you doing any static translations, by chance? https://craftcms.com/support/static-translations
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-01-10T09:44:59.500Z
Comments.Text: Tried to comment out all the different translations-files until i found the culprit. There was an error in one of the files where the key did not get a value.
Comments.UserDisplayName: KnutSv
Tags: <javascript><editing>
Title: Javascript issue when setting an expiry date for entry
ThreadText: # Javascript issue when setting an expiry date for entry
  
  (Asked by: username_0 on 2017-01-04)
  
  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](https://i.sstatic.net/rWhub.png)](https://i.sstatic.net/rWhub.png)
  [![Line causing the error](https://i.sstatic.net/KVuFJ.png)](https://i.sstatic.net/KVuFJ.png)
  
  **Tags:** javascript, editing
  
  > **Comments:**
  > **username_1**: 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?  
  > **username_0**: 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.  
  > **username_1**: 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).  
  > **username_0**: Added some screenshots.  
  > **username_1**: Whoa... weird.  Are you doing any static translations, by chance? https://craftcms.com/support/static-translations  
  > **username_0**: Tried to comment out all the different translations-files until i found the culprit. There was an error in one of the files where the key did not get a value.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-01-10. Score: 2 | Accepted answer
  
  The issue here was an error in a translations file:
  
  ```
  array(
      'some key' => 'some value',
      'key missing value',   <== no value assigned to this key
      'other key' => 'other value value'
  );
  
  ```
  
  > **Comments:**
  > **username_1**: Wow... super-random, but nice find!  
  
  ---
  
  