本文整理汇总了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
};
}-*/;
示例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
}
}-*/;
示例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;
}
示例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);
}
示例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());
}
示例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);
}
}
示例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()));
}
}
示例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()));
}
}
示例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();
}
}
示例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;
}
}
示例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);
}
示例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());
}
示例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
};
}-*/;
示例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);
}
}-*/;
示例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);
}
}-*/;