本文整理汇总了C++中DateComponents::setMillisecondsSinceEpochForDate方法的典型用法代码示例。如果您正苦于以下问题:C++ DateComponents::setMillisecondsSinceEpochForDate方法的具体用法?C++ DateComponents::setMillisecondsSinceEpochForDate怎么用?C++ DateComponents::setMillisecondsSinceEpochForDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateComponents
的用法示例。
在下文中一共展示了DateComponents::setMillisecondsSinceEpochForDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeDocument
void CalendarPickerElement::writeDocument(DocumentWriter& writer)
{
HTMLInputElement* input = hostInput();
DateComponents date;
date.setMillisecondsSinceEpochForDate(input->minimum());
String minString = date.toString();
date.setMillisecondsSinceEpochForDate(input->maximum());
String maxString = date.toString();
Decimal step;
String stepString = input->fastGetAttribute(stepAttr);
if (stepString.isEmpty() || !input->getAllowedValueStep(&step))
stepString = "1";
addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
writer.addData(calendarPickerCss, sizeof(calendarPickerCss));
if (document()->page()) {
CString extraStyle = document()->page()->theme()->extraCalendarPickerStyleSheet();
if (extraStyle.length())
writer.addData(extraStyle.data(), extraStyle.length());
}
addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", writer);
addProperty("min", minString, writer);
addProperty("max", maxString, writer);
addProperty("step", stepString, writer);
addProperty("required", input->required(), writer);
addProperty("currentValue", input->value(), writer);
addProperty("locale", defaultLanguage(), writer);
addProperty("todayLabel", calendarTodayText(), writer);
addProperty("clearLabel", calendarClearText(), writer);
addProperty("weekStartDay", firstDayOfWeek(), writer);
addProperty("monthLabels", monthLabels(), writer);
addProperty("dayLabels", weekDayShortLabels(), writer);
Direction dir = direction(monthLabels()[0][0]);
addProperty("isRTL", dir == RightToLeft || dir == RightToLeftArabic, writer);
addString("}\n", writer);
writer.addData(calendarPickerJs, sizeof(calendarPickerJs));
addString("</script></body>\n", writer);
}
示例2: valueToDateTimeString
static String valueToDateTimeString(double value, AtomicString type)
{
DateComponents components;
if (type == InputTypeNames::date)
components.setMillisecondsSinceEpochForDate(value);
else if (type == InputTypeNames::datetime_local)
components.setMillisecondsSinceEpochForDateTimeLocal(value);
else if (type == InputTypeNames::month)
components.setMonthsSinceEpoch(value);
else if (type == InputTypeNames::time)
components.setMillisecondsSinceMidnight(value);
else if (type == InputTypeNames::week)
components.setMillisecondsSinceEpochForWeek(value);
else
ASSERT_NOT_REACHED();
return components.type() == DateComponents::Invalid ? String() : components.toString();
}
示例3: dateComponents
DateComponents dateComponents(int year, int month, int day)
{
DateComponents date;
date.setMillisecondsSinceEpochForDate(msForDate(year, month, day));
return date;
}