Skip to content

Commit

Permalink
docs(datepicker): add property docs for $mdDateLocaleProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn authored and kennethcachia committed Sep 23, 2015
1 parent ac582c8 commit f45c561
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
15 changes: 15 additions & 0 deletions docs/config/template/ngdoc/lib/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@
</table>
{% endmacro -%}

{%- macro propertyTable(params) %}
<table class="md-api-table">
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{$ paramList(params) $}
</tbody>
</table>
{% endmacro -%}



{%- macro directiveParam(name, type, join, sep) %}
Expand Down
10 changes: 3 additions & 7 deletions docs/config/template/ngdoc/lib/properties.template.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
{%- if doc.properties %}
<section class="api-section">
<h2>Properties</h2>
<ul class="properties">
{%- for property in doc.properties %}
<li id="{$ property.name $}">
<h3>{$ property.name | code $}</h3>
TYPE INFO FOR {$ property | json $}
</li>
{% endfor -%}
<div class="api-param-table">
{$ propertyTable(doc.properties) $}
</div>
</ul>
</section>
{%- endif -%}
17 changes: 17 additions & 0 deletions src/components/datepicker/dateLocaleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
* internationalization. The `$mdDateLocale` service itself is consumed by Angular Material
* components that that deal with dates.
*
* @property {(Array<string>)=} months Array of month names (in order).
* @property {(Array<string>)=} shortMonths Array of abbreviated month names.
* @property {(Array<string>)=} days Array of the days of the week (in order).
* @property {(Array<string>)=} shortDays Array of abbreviated dayes of the week.
* @property {(Array<string>)=} dates Array of dates of the month. Only necessary for locales
* using a numeral system other than [1, 2, 3...].
* @property {(function(string): Date)=} parseDate Function to parse a date object from a string.
* @property {(function(Date): string)=} formatDate Function to format a date object to a string.
* @property {(function(Date): string)=} monthHeaderFormatter Function that returns the label for
* a month given a date.
* @property {(function(number): string)=} weekNumberFormatter Function that returns a label for
* a week given the week number.
* @property {(string)=} msgCalendar Translation of the label "Calendar" for the current locale.
* @property {(string)=} msgOpenCalendar Translation of the button label "Open calendar" for the
* current locale.
*
* @usage
* <hljs lang="js">
* myAppModule.config(function($mdDateLocaleProvider) {
Expand Down Expand Up @@ -52,6 +68,7 @@
* </hljs>
*
*/

angular.module('material.components.datepicker').config(function($provide) {
// TODO(jelbourn): Assert provided values are correctly formatted. Need assertions.

Expand Down
9 changes: 3 additions & 6 deletions src/components/datepicker/datePicker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
(function() {
'use strict';

// PRE RELEASE
// TODO(jelbourn): Documentation
// TODO(jelbourn): Demo that uses moment.js

// POST RELEASE
// TODO(jelbourn): Demo that uses moment.js
// TODO(jelbourn): make sure this plays well with validation and ngMessages.
// TODO(jelbourn): calendar pane doesn't open up outside of visible viewport.
// TODO(jelbourn): forward more attributes to the internal input (required, autofocus, etc.)
Expand All @@ -23,12 +20,12 @@
* @name mdDatepicker
* @module material.components.datepicker
*
* @param {Date} ng-model The component's model. Uses a JavaScript Date object.
* @param {Date} ng-model The component's model. Expects a JavaScript Date object.
* @param {boolean=} disabled Whether the datepicker is disabled.
*
* @description
* `<md-datepicker>` is a component used to select a single date.
* For information on how to configure internationalization for the date piicker,
* For information on how to configure internationalization for the date picker,
* see `$mdDateLocaleProvider`.
*
* @usage
Expand Down

0 comments on commit f45c561

Please sign in to comment.