Skip to content

Commit

Permalink
Fixed #2188
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Mar 1, 2017
1 parent a68c434 commit 47ca260
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
11 changes: 3 additions & 8 deletions components/schedule/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class Schedule implements DoCheck,OnDestroy,OnInit,OnChanges,AfterViewChe

@Input() eventConstraint: any;

@Input() locale: any;
@Input() locale: string;

@Input() timezone: boolean | string = false;

Expand Down Expand Up @@ -143,6 +143,7 @@ export class Schedule implements DoCheck,OnDestroy,OnInit,OnChanges,AfterViewChe
aspectRatio: this.aspectRatio,
eventLimit: this.eventLimit,
defaultDate: this.defaultDate,
locale: this.locale,
timezone: this.timezone,
editable: this.editable,
droppable: this.droppable,
Expand Down Expand Up @@ -259,13 +260,7 @@ export class Schedule implements DoCheck,OnDestroy,OnInit,OnChanges,AfterViewChe
});
}
};

if(this.locale) {
for(let prop in this.locale) {
this.config[prop] = this.locale[prop];
}
}


if(this.options) {
for(let prop in this.options) {
this.config[prop] = this.options[prop];
Expand Down
23 changes: 3 additions & 20 deletions showcase/demo/schedule/scheduledemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,28 +191,11 @@ <h3>Localization</h3>
Following is a schedule with Spanish month names.</p>
<pre>
<code class="language-markup" pCode>
&lt;p-schedule [events]="events" [locale]="es"&gt;&lt;/p-schedule&gt;
&lt;p-schedule [events]="events" locale="es"&gt;&lt;/p-schedule&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode>
export class MyModel &#123;

es: any;

ngOnInit() &#123;
this.es = &#123;
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio',
'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
&#125;;
&#125;
&#125;
</code>
</pre>
<p>Visit the <a href="http://fullcalendar.io/docs/text/">fullcalendar documentation</a> for the available options.
Existing translations are available at <a href="https://github.com/fullcalendar/fullcalendar/tree/master/lang">here</a>.
</p>
<p>Visit the <a href="https://fullcalendar.io/docs/text/locale/">fullcalendar documentation</a> to get the available locales.</a>.</p>

<h3>Attributes</h3>
<div class="doc-tablewrapper">
Expand Down Expand Up @@ -253,7 +236,7 @@ <h3>Attributes</h3>
<tr>
<td>locale</td>
<td>object</td>
<td><a href="http://fullcalendar.io/docs/text/">Read more</a></td>
<td><a href="https://fullcalendar.io/docs/text/locale/">Read more</a></td>
</tr>
<tr>
<td>fixedWeekCount</td>
Expand Down

0 comments on commit 47ca260

Please sign in to comment.