Android Open Source - libCalendar i Cal Utility






From Project

Back to project page libCalendar.

License

The source code is released under:

MIT License

If you think the Android project libCalendar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.darkrockstudios.libs.calendar;
// w  w w.  j ava 2  s  . c om
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class iCalUtility
{
  public static long parseDuration( String icalDuration )
  {
    final int GROUP_SECONDS = 1;
    final String PATTERN = "-?P(\\d)+S";

    long durationInSeconds = -1;

    Pattern p = Pattern.compile( PATTERN );
    Matcher m = p.matcher( icalDuration );
    if( m.groupCount() > 1 )
    {
      durationInSeconds = Long.parseLong( m.group( GROUP_SECONDS ) );
    }

    return durationInSeconds;
  }
}




Java Source Code List

com.darkrockstudios.libs.calendar.CalendarUtility.java
com.darkrockstudios.libs.calendar.Calendar.java
com.darkrockstudios.libs.calendar.EventUtility.java
com.darkrockstudios.libs.calendar.Event.java
com.darkrockstudios.libs.calendar.InstanceUtility.java
com.darkrockstudios.libs.calendar.Instance.java
com.darkrockstudios.libs.calendar.iCalUtility.java