Skip to content

Entries: Add deprecation warning to date method #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions entries/date-method.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0"?>
<entry name="date" type="method" return="Boolean">
<title>date method</title>
<title>[DEPRECATED] date method</title>
<desc>Makes the element require a date.</desc>
<longdesc>
Return true if the value is a valid date. Uses JavaScript's built-in Date to test if the date is valid, and therefore does no sanity checks. Only the format must be valid, not the actual date, eg 30/30/2008 is a valid date.
<p>This method should not be used, since it relies on the <code>new Date</code> constructor, which behaves very differently across browsers and locales. Use <code>dateISO</code> instead or one of the locale specific methods (in localizations/ and additional-methods.js).</p>
<p><strong>DEPRECATION warning:</strong></p>
<p style="font-style: italic;"><strong>This method is deprecated and will be removed in version <code>2.0.0</code>.<br/>Please don't use it, since it relies on the <code>Date</code> constructor, which behaves very differently across browsers and locales. Use <code>dateISO</code> instead or one of the locale specific methods (in localizations/ and additional-methods.js).</strong></p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm

Should I extend this explanation with some examples?
IMHO, I think this message suffice.

</longdesc>
<example>
<desc>Makes "field" required and a date.</desc>
Expand Down