https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292023-03-06T10:45:29ZRedmineRedmine - Feature #38231: Limit the year to 4 digits in date inputhttps://www.redmine.org/issues/38231?journal_id=1094642023-03-06T10:45:29ZHolger Just
<ul></ul><p>Rather then using <code>options.merge(max: '9999-12-31')</code>, I'd propose to use <code>options.reverse_merge(max: '9999-12-31')</code>. That way, callers of the <code>date_field</code> and <code>date_field_tag</code> helpers can still provide a custom <code>max</code> value if required which will then take precedence before the default value <code>9999-12-31</code>.</p>
<p>Apart from that, this looks good to me and is a nice unintrusive improvement. Not being able to enter dates almost 8000 years in the future should not be an issue for us.</p> Redmine - Feature #38231: Limit the year to 4 digits in date inputhttps://www.redmine.org/issues/38231?journal_id=1096062023-03-29T04:27:15ZGo MAEDA
<ul><li><strong>File</strong> <a href="/attachments/30261">limit-year-to-4-digits-v2.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/30261/limit-year-to-4-digits-v2.patch">limit-year-to-4-digits-v2.patch</a> added</li><li><strong>Target version</strong> set to <i>5.1.0</i></li></ul><p>Holger Just wrote in <a href="#note-1">#note-1</a>:</p>
<blockquote>
<p>Rather then using <code>options.merge(max: '9999-12-31')</code>, I'd propose to use <code>options.reverse_merge(max: '9999-12-31')</code>. That way, callers of the <code>date_field</code> and <code>date_field_tag</code> helpers can still provide a custom <code>max</code> value if required which will then take precedence before the default value <code>9999-12-31</code>.</p>
</blockquote>
<p>Thank you for the suggestion, I didn't know <code>reverse_merge</code>. It is a more desirable behavior.</p>
<p>Setting the target version to 5.1.0.</p> Redmine - Feature #38231: Limit the year to 4 digits in date inputhttps://www.redmine.org/issues/38231?journal_id=1096102023-03-30T01:11:33ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed the patch.</p>