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


Java JsDate类代码示例

本文整理汇总了Java中com.google.gwt.core.client.JsDate的典型用法代码示例。如果您正苦于以下问题:Java JsDate类的具体用法?Java JsDate怎么用?Java JsDate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsDate类属于com.google.gwt.core.client包,在下文中一共展示了JsDate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
public native static JsMessage create(String rid,
                                      String sortKey,
                                      JsPeerInfo sender,
                                      boolean isOut,
                                      String date,
                                      JsDate fullDate,
                                      String state,
                                      boolean isOnServer,
                                      JsContent content,
                                      JsArray<JsReaction> reactions,
                                      double sortDate)/*-{
    return {
        rid: rid,
        sortKey: sortKey,
        sender: sender,
        isOut: isOut,
        date: date,
        fullDate: fullDate,
        state: state,
        isOnServer: isOnServer,
        content: content,
        reactions: reactions,
        sortDate: sortDate
    };
}-*/;
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:26,代码来源:JsMessage.java

示例2: create

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
public static native JsAuthSession create(
        int id,
        String holder,
        int appId,
        String appTitle,
        String deviceTitle,
        JsDate authTime,
        String authLocation,
        Double latitude,
        Double longitude
)/*-{
    return {
        id: id,
        holder: holder,
        appId: appId,
        appTitle: appTitle,
        deviceTitle: deviceTitle,
        authTime: authTime,
        authLocation: authLocation,
        latitude: latitude,
        longitude: longitude
    }
}-*/;
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:24,代码来源:JsAuthSession.java

示例3: toJso

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
public JsArrayMixed toJso(List<Object> args) {
    JsArrayMixed result = (JsArrayMixed) JavaScriptObject.createArray();
    for (Object o : args) {
        if (o == null) {
            result.push((JavaScriptObject) null);
        } else if (o instanceof String) {
            result.push((String) o);
        } else if (o instanceof Date) {
            result.push(JsDate.create(((Date) o).getTime()));
        } else if (o instanceof Double) {
            result.push(((Double) o).doubleValue());
        } else {
            throw new IllegalArgumentException("Don't know how to handle "
                    + o);
        }
    }
    return result;
}
 
开发者ID:salk31,项目名称:RedQueryBuilder,代码行数:19,代码来源:JsList.java

示例4: convert

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
@Override
public JsMessage convert(Message value) {
    JsMessenger messenger = JsMessenger.getInstance();

    String rid = value.getRid() + "";
    String sortKey = value.getSortDate() + "";

    JsPeerInfo sender = messenger.buildPeerInfo(Peer.user(value.getSenderId()));
    boolean isOut = value.getSenderId() == messenger.myUid();
    boolean isOnServer = value.isOnServer();
    String date = messenger.getFormatter().formatTime(value.getDate());
    JsDate fullDate = JsDate.create(value.getDate());

    JsContent content = JsContent.createContent(value.getContent(),
            value.getSenderId());

    JsArray<JsReaction> reactions = JsArray.createArray().cast();

    for (Reaction r : value.getReactions()) {
        JsArrayInteger uids = (JsArrayInteger) JsArrayInteger.createArray();
        boolean isOwnSet = false;
        for (Integer i : r.getUids()) {
            uids.push(i);
            if (i == messenger.myUid()) {
                isOwnSet = true;
            }
        }
        reactions.push(JsReaction.create(r.getCode(), uids, isOwnSet));
    }
    double sortDate = value.getDate() / 1000.0;
    return create(rid, sortKey, sender, isOut, date, fullDate, Enums.convert(value.getMessageState()), isOnServer, content,
            reactions, sortDate);
}
 
开发者ID:wex5,项目名称:dangchat-sdk,代码行数:34,代码来源:JsMessage.java

示例5: toModelValue

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
@Override
public Date toModelValue(final String widgetValue) {
  if (widgetValue == null || widgetValue.equals("")) {
    return null;
  }

  final JsDate jsDate = JsDate.create(widgetValue);
  return new Date((long) jsDate.getTime());
}
 
开发者ID:mbarkley,项目名称:errai-crud,代码行数:10,代码来源:DateConverter.java

示例6: toWidgetValue

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
@Override
public String toWidgetValue(final Date modelValue) {
  if (modelValue == null) {
    return "";
  } else {
    final JsDate jsDate = JsDate.create(((Long) modelValue.getTime()).doubleValue());
    return toISODate(jsDate);
  }
}
 
开发者ID:mbarkley,项目名称:errai-crud,代码行数:10,代码来源:DateConverter.java

示例7: setDateMin

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Set the minimum date limit.
 */
public void setDateMin(Date dateMin) {
    this.dateMin = dateMin;

    if (isAttached() && dateMin != null) {
        getPicker().set("min", JsDate.create((double) dateMin.getTime()));
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:11,代码来源:MaterialDatePicker.java

示例8: setDateMax

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Set the maximum date limit.
 */
public void setDateMax(Date dateMax) {
    this.dateMax = dateMax;

    if (isAttached() && dateMax != null) {
        getPicker().set("max", JsDate.create((double) dateMax.getTime()));
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:11,代码来源:MaterialDatePicker.java

示例9: setPickerDate

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Set the pickers date.
 */
public void setPickerDate(JsDate date, Element picker) {
    try {
        $(picker).pickadate("picker").set("select", date, () -> {
            DOM.createFieldSet().setPropertyObject("muted", true);
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:13,代码来源:MaterialDatePicker.java

示例10: getPickerDate

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Get the pickers date.
 */
protected Date getPickerDate() {
    try {
        JsDate pickerDate = getPicker().get("select").obj;
        return new Date((long) pickerDate.getTime());
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:13,代码来源:MaterialDatePicker.java

示例11: setValue

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
@Override
public void setValue(Date value, boolean fireEvents) {
    if (value == null) {
        clear();
        return;
    }
    this.date = value;
    if (isAttached()) {
        suppressChangeEvent = !fireEvents;
        setPickerDate(JsDate.create((double) value.getTime()), pickatizedDateInput);
        suppressChangeEvent = false;
        label.addStyleName(CssName.ACTIVE);
    }
    super.setValue(value, fireEvents);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material,代码行数:16,代码来源:MaterialDatePicker.java

示例12: onDpValue

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
@UiHandler("btnDpValue")
void onDpValue(ClickEvent e) {
    //dpValue.setValue(new Date());
    dpValue.setValue(new Date(), false);
    Long l = new Date().getTime();
    l = l - 2592000000L;      //1 Months in Milliseconds = 2592000000
    Date dd = new Date();
    dd.setTime(l);
    dpValue.setPickerDate(JsDate.create(dd.getTime()), dpValue.getDateInput().getElement());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:11,代码来源:PickersView.java

示例13: create

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
public native static JsMessage create(String rid, String sortKey, JsPeerInfo sender, boolean isOut, String date, JsDate fullDate, String state, boolean isOnServer, JsContent content)/*-{
    return {
        rid: rid,
        sortKey: sortKey,
        sender: sender,
        isOut: isOut,
        date: date,
        fullDate: fullDate,
        state: state,
        isOnServer: isOnServer,
        content: content
    };
}-*/;
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:14,代码来源:JsMessage.java

示例14: setPicker

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Sets the value of picker.
 * 
 * @param value
 */
public native void setPicker(JsDate value) /*-{
	var comp = [email protected]::getOrCreateJsObj()();
	if (comp != null) {
		comp.setPicker(value);
	}
}-*/;
 
开发者ID:ahome-it,项目名称:ahome-touch,代码行数:12,代码来源:DatePickerField.java

示例15: setValue

import com.google.gwt.core.client.JsDate; //导入依赖的package包/类
/**
 * Sets the value of value.
 * 
 * @param value
 */
public native void setValue(JsDate value) /*-{
	var comp = [email protected]::getOrCreateJsObj()();
	if (comp != null) {
		comp.setValue(value);
	}
}-*/;
 
开发者ID:ahome-it,项目名称:ahome-touch,代码行数:12,代码来源:DatePickerField.java


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