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


C++ DateComponents::fullYear方法代码示例

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


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

示例1: shouldYearFieldDisabled

bool DateTimeEditBuilder::shouldYearFieldDisabled() const
{
    return m_parameters.minimum.type() != DateComponents::Invalid
        && m_parameters.maximum.type() != DateComponents::Invalid
        && m_parameters.minimum.fullYear() == m_parameters.maximum.fullYear()
        && m_parameters.minimum.fullYear() == m_dateValue.fullYear();
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:7,代码来源:DateTimeEditElement.cpp

示例2: generateMHTMLHeader

void MHTMLArchive::generateMHTMLHeader(
    const String& boundary, const String& title, const String& mimeType,
    SharedBuffer& outputBuffer)
{
    DateComponents now;
    now.setMillisecondsSinceEpochForDateTime(currentTimeMS());
    // TODO(lukasza): Passing individual date/time components seems fragile.
    String dateString = makeRFC2822DateString(
        now.weekDay(), now.monthDay(), now.month(), now.fullYear(),
        now.hour(), now.minute(), now.second(), 0);

    StringBuilder stringBuilder;
    stringBuilder.appendLiteral("From: <Saved by Blink>\r\n");
    stringBuilder.appendLiteral("Subject: ");
    // We replace non ASCII characters with '?' characters to match IE's behavior.
    stringBuilder.append(replaceNonPrintableCharacters(title));
    stringBuilder.appendLiteral("\r\nDate: ");
    stringBuilder.append(dateString);
    stringBuilder.appendLiteral("\r\nMIME-Version: 1.0\r\n");
    stringBuilder.appendLiteral("Content-Type: multipart/related;\r\n");
    stringBuilder.appendLiteral("\ttype=\"");
    stringBuilder.append(mimeType);
    stringBuilder.appendLiteral("\";\r\n");
    stringBuilder.appendLiteral("\tboundary=\"");
    stringBuilder.append(boundary);
    stringBuilder.appendLiteral("\"\r\n\r\n");

    // We use utf8() below instead of ascii() as ascii() replaces CRLFs with ??
    // (we still only have put ASCII characters in it).
    ASSERT(stringBuilder.toString().containsOnlyASCII());
    CString asciiString = stringBuilder.toString().utf8();

    outputBuffer.append(asciiString.data(), asciiString.length());
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:34,代码来源:MHTMLArchive.cpp

示例3: fullYear

int BaseMultipleFieldsDateAndTimeInputType::fullYear(const String& source) const
{
    DateComponents date;
    if (!parseToDateComponents(source, &date))
        return DateTimeEditElement::LayoutParameters::undefinedYear();
    return date.fullYear();
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: currentFullYear

static int currentFullYear()
{
    double current = currentTimeMS();
    double utcOffset = calculateUTCOffset();
    double dstOffset = calculateDSTOffset(current, utcOffset);
    int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
    current += offset * msPerMinute;

    DateComponents date;
    date.setMillisecondsSinceEpochForMonth(current);
    return date.fullYear();
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:12,代码来源:DateTimeFieldElements.cpp

示例5: defaultValueForStepDown

int DateTimeYearFieldElement::defaultValueForStepDown() const
{
    double current = currentTimeMS();
    double utcOffset = calculateUTCOffset();
    double dstOffset = calculateDSTOffset(current, utcOffset);
    int offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
    current += offset * msPerMinute;

    DateComponents date;
    date.setMillisecondsSinceEpochForMonth(current);
    return date.fullYear();
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例6: setOnlyYearMonthDay

void DateTimeEditElement::setOnlyYearMonthDay(const DateComponents& date)
{
    ASSERT(date.type() == DateComponents::Date);

    if (!m_editControlOwner)
        return;

    DateTimeFieldsState dateTimeFieldsState = valueAsDateTimeFieldsState();
    dateTimeFieldsState.setYear(date.fullYear());
    dateTimeFieldsState.setMonth(date.month() + 1);
    dateTimeFieldsState.setDayOfMonth(date.monthDay());
    setValueAsDateTimeFieldsState(dateTimeFieldsState);
    m_editControlOwner->editControlValueChanged();
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:14,代码来源:DateTimeEditElement.cpp

示例7: setValueAsDate

void DateTimeYearFieldElement::setValueAsDate(const DateComponents& date)
{
    setValueAsInteger(date.fullYear());
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:4,代码来源:DateTimeFieldElements.cpp

示例8: formatDate

String LocaleWin::formatDate(const DateComponents& dateComponents)
{
    ensureShortDateTokens();
    return formatDate(m_shortDateTokens, m_baseYear, dateComponents.fullYear(), dateComponents.month(), dateComponents.monthDay());
}
开发者ID:,项目名称:,代码行数:5,代码来源:

示例9: currentFullYear

static int currentFullYear()
{
    DateComponents date;
    date.setMillisecondsSinceEpochForMonth(convertToLocalTime(currentTimeMS()));
    return date.fullYear();
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:6,代码来源:DateTimeFieldElements.cpp


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