gpt4 book ai didi

org.hippoecm.frontend.plugins.yui.datetime.YuiDateTimeField.setDate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 20:01:31 26 4
gpt4 key购买 nike

本文整理了Java中org.hippoecm.frontend.plugins.yui.datetime.YuiDateTimeField.setDate()方法的一些代码示例,展示了YuiDateTimeField.setDate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YuiDateTimeField.setDate()方法的具体详情如下:
包路径:org.hippoecm.frontend.plugins.yui.datetime.YuiDateTimeField
类名称:YuiDateTimeField
方法名:setDate

YuiDateTimeField.setDate介绍

暂无

代码示例

代码示例来源:origin: org.onehippo.cms7/hippo-cms-yui

@Override
public void onClick(AjaxRequestTarget target) {
  ((FormComponent<Date>) YuiDateTimeField.this.get("date")).clearInput();
  MutableDateTime date = new MutableDateTime(new Date());
  boolean use12HourFormat = use12HourFormat();
  int hours = date.getHourOfDay() % (use12HourFormat ? 12 : 24);
  setHours(hours);
  setMinutes(date.getMinuteOfHour());
  setDate(date.toDate());
  if (target != null) {
    target.addComponent(YuiDateTimeField.this);
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-yui

private void updateDateTime(Date date, Integer hours, Integer minutes) {
  if(date!=null) {
    MutableDateTime datetime = new MutableDateTime(date);
    try {
      TimeZone zone = getClientTimeZone();
      if (zone != null) {
        datetime.setZone(DateTimeZone.forTimeZone(zone));
      }
      if (hours != null) {
        datetime.set(DateTimeFieldType.hourOfDay(), hours % 24);
        datetime.setMinuteOfHour(minutes != null ? minutes : 0);
      }
      // the date will be in the server's timezone
      setDate(datetime.toDate());
      //setModelObject(datetime.toDate());
    } catch (RuntimeException e) {
      error(e.getMessage());
      invalid();
    }
  }
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-api

private void updateDateTime() {
  final Date date = getDate();
  if (date != null) {
    final MutableDateTime dateTime = new MutableDateTime(date);
    try {
      final TimeZone zone = getClientTimeZone();
      if (zone != null) {
        dateTime.setZone(DateTimeZone.forTimeZone(zone));
      }
      setHourAndMinutes(dateTime);
      // the date will be in the server's timezone
      setDate(dateTime.toDate());
      setModelObject(dateTime.toDate());
    } catch (final RuntimeException e) {
      error(e.getMessage());
      invalid();
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com