当前位置: 首页>>代码示例>>Java>>正文


Java DateTime.toAllDay方法代码示例

本文整理汇总了Java中org.dmfs.rfc5545.DateTime.toAllDay方法的典型用法代码示例。如果您正苦于以下问题:Java DateTime.toAllDay方法的具体用法?Java DateTime.toAllDay怎么用?Java DateTime.toAllDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dmfs.rfc5545.DateTime的用法示例。


在下文中一共展示了DateTime.toAllDay方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFrom

import org.dmfs.rfc5545.DateTime; //导入方法依赖的package包/类
@Override
public DateTime getFrom(ContentValues values)
{
    Long timestamp = values.getAsLong(mTimestampField);
    if (timestamp == null)
    {
        // if the time stamp is null we return null
        return null;
    }
    // create a new Time for the given time zone, falling back to UTC if none is given
    String timezone = mTzField == null ? null : values.getAsString(mTzField);
    DateTime value = new DateTime(timezone == null ? DateTime.UTC : TimeZone.getTimeZone(timezone), timestamp);

    // cache mAlldayField locally
    String allDayField = mAllDayField;

    // set the allday flag appropriately
    Integer allDayInt = allDayField == null ? null : values.getAsInteger(allDayField);

    if ((allDayInt != null && allDayInt != 0) || (allDayField == null && mAllDayDefault))
    {
        value = value.toAllDay();
    }

    return value;
}
 
开发者ID:dmfs,项目名称:opentasks,代码行数:27,代码来源:DateTimeFieldAdapter.java

示例2: getFrom

import org.dmfs.rfc5545.DateTime; //导入方法依赖的package包/类
@Override
public DateTime getFrom(ContentValues values)
{
	Long timestamp = values.getAsLong(mTimestampField);
	if (timestamp == null)
	{
		// if the time stamp is null we return null
		return null;
	}
	// create a new Time for the given time zone, falling back to UTC if none is given
	String timezone = mTzField == null ? null : values.getAsString(mTzField);
	DateTime value = new DateTime(timezone == null ? DateTime.UTC : TimeZone.getTimeZone(timezone), timestamp);

	// cache mAlldayField locally
	String allDayField = mAllDayField;

	// set the allday flag appropriately
	Integer allDayInt = allDayField == null ? null : values.getAsInteger(allDayField);

	if ((allDayInt != null && allDayInt != 0) || (allDayField == null && mAllDayDefault))
	{
		value = value.toAllDay();
	}

	return value;
}
 
开发者ID:dmfs,项目名称:opentasks-provider,代码行数:27,代码来源:DateTimeFieldAdapter.java

示例3: iterator

import org.dmfs.rfc5545.DateTime; //导入方法依赖的package包/类
/**
 * Get a new {@link RuleIterator} that iterates all instances of this rule. <p> <strong>Note:</strong> If the rule contains an UNTIL part with a floating
 * value, you have to provide <code>null</code> as the timezone. </p>
 *
 * @param start
 *         The time of the first instance in milliseconds since the epoch.
 * @param timezone
 *         The {@link TimeZone} of the first instance or <code>null</code> for floating times.
 *
 * @return A {@link RecurrenceRuleIterator}.
 */
public RecurrenceRuleIterator iterator(long start, TimeZone timezone)
{
    // TODO: avoid creating a temporary DATETIME instance.
    DateTime dt = new DateTime(mCalendarMetrics, timezone, start);
    DateTime until = getUntil();
    if (until != null && until.isAllDay())
    {
        dt = dt.toAllDay();
    }
    return iterator(dt);
}
 
开发者ID:dmfs,项目名称:lib-recur,代码行数:23,代码来源:RecurrenceRule.java


注:本文中的org.dmfs.rfc5545.DateTime.toAllDay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。