<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>

CC BY-SA 3.0
2017-01-11T01:58:16.823Z
Wow... super-random, but nice find!
Brad Bell
CC BY-SA 3.0
2017-01-10T09:47:00.197Z
2017-01-10T09:47:00.197Z
KnutSv
<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>

CC BY-SA 3.0
2017-01-09T21:55:37.887Z
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
CC BY-SA 3.0
2017-01-09T22:40:29.593Z
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
CC BY-SA 3.0
2017-01-09T22:46:46.933Z
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
CC BY-SA 3.0
2017-01-09T22:58:22.650Z
Added some screenshots.
KnutSv
CC BY-SA 3.0
2017-01-09T23:00:59.933Z
Whoa... weird.  Are you doing any static translations, by chance? https://craftcms.com/support/static-translations
Brad Bell
CC BY-SA 3.0
2017-01-10T09:44:59.500Z
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.
KnutSv
<javascript><editing>
Javascript issue when setting an expiry date for entry
# 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.

**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!  

---

