Skip to content

Commit bdf5993

Browse files
Merge pull request #5 from petebacondarwin/master
Changed formatted date to use built-in angular date filter
2 parents b4a3397 + d5d459e commit bdf5993

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

angular-ui

Submodule angular-ui updated from 8adfba9 to 8689154

index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ <h1>Date</h1>
210210
<h3>What?</h3>
211211
<p>Calendar picker with ng-model integration</p>
212212
<div class="well">
213-
<p><input value="Click Here for Datepicker" ng-model="date" ui-date></p>
213+
<ng-form name="dateForm">
214+
<p><input name="dateField" value="Click Here for Datepicker" ng-model="date" ui-date></p>
215+
</ng-form>
214216
<p>Selected Date: {{ date }}</p>
215-
<p>Formatted Date: {{ date.toLocaleDateString() }}</p>
217+
<p>Formatted Date: {{ date | date: 'mediumDate'}}</p>
216218
<p>Selected Month: {{ date.getMonth() }}</p>
217219
<div ng-model="date" ui-date></div>
218220
</div>
@@ -225,7 +227,7 @@ <h3>How?</h3>
225227
<pre class="prettyprint linenums" ng-non-bindable>
226228
&lt;input ng-model="date" ui-date&gt;
227229
Selected Date: {{ date }}
228-
Formatted Date: {{ date.toLocaleDateString() }}
230+
Formatted Date: {{ date | date: 'mediumDate'}}
229231
Selected Month: {{ date.getMonth() }}
230232
&lt;div ng-model="date" ui-date&gt;&lt;/div&gt;
231233
</pre>

0 commit comments

Comments
 (0)