| |
@@ -16,6 +16,20 @@
|
| |
const DATE_FORMAT = 'dddd, MMMM Do YYYY';
|
| |
const TIME_FORMAT = 'h:mm a z';
|
| |
|
| |
+ /*
|
| |
+ Convert title to capital case, but skip special names like FESCo, FAmSCo, i18n
|
| |
+ */
|
| |
+ function calendarNameToDisplayName(name:string) :string {
|
| |
+ switch(name) {
|
| |
+ case 'i18n':
|
| |
+ return 'i18n';
|
| |
+ case 'fesco':
|
| |
+ return 'FESCo';
|
| |
+ default:
|
| |
+ return /^[A-Z][^\d-]*.*$/.test(name) ? name : _.startCase(name);
|
| |
+ }
|
| |
+
|
| |
+ }
|
| |
|
| |
/*
|
| |
Generated class for the FedoCal provider.
|
| |
@@ -44,7 +58,7 @@
|
| |
this.calendars = _.map(data.calendars, c => {
|
| |
return {
|
| |
real_name: c.calendar_name,
|
| |
- display_name: _.camelCase(c.calendar_name),
|
| |
+ display_name: calendarNameToDisplayName(c.calendar_name),
|
| |
description: c.calendar_description,
|
| |
contact: c.calendar_contact,
|
| |
};
|
| |
@@ -103,3 +117,4 @@
|
| |
function dateToMoment(date, time, timezone) {
|
| |
return moment.tz(date + 'T' + time + 'Z', timezone).tz('Etc/UTC');
|
| |
}
|
| |
+
|
| |
Takes care of proper naming in calendar, converts title to Capital Case and also takes care of exceptions.
Fixes #18