icalendar/icalendar — pull request #86 by jnv (2014-08-28 17:51:56+00:00)
Title: Incorrect TZNAME in some timezones 

Current extensions for `TZInfo::TimezonePeriod` [uses simple string replacement](https://github.com/icalendar/icalendar/blob/62a274decb620b4cf8f05615794cb4a82d30a334/lib/icalendar/tzinfo.rb#L136) to generate `TZNAME` from the timezone code for standard and daylight time (e.g. EST and EDT). However, some timzones do not use *DT or *ST as part of the code, for example in Central Europe, we have CET and CEST (and CEST and CEDT both mean summer/daylight time!); current code does not account for these cases and generates incorrect TZNAME:

```ruby
require 'icalendar/tzinfo'
tz = TZInfo::Timezone.get('Europe/Prague')
tz.ical_timezone(DateTime.new 2014).to_ical
```

outputs:

```
BEGIN:VTIMEZONE
TZID:Europe/Prague
BEGIN:DAYLIGHT
# ...
TZNAME:CET
END:DAYLIGHT
BEGIN:STANDARD
# ...
TZNAME:CET
END:STANDARD
END:VTIMEZONE
```

This fix uses an abbreviation correctly generated by TZInfo.

Furthermore I'd like to deduplicate the code in `daylight`/`standard` methods, I will send it as a separate PR.