Example usage for com.google.gwt.core.client JsDate create

List of usage examples for com.google.gwt.core.client JsDate create

Introduction

In this page you can find the example usage for com.google.gwt.core.client JsDate create.

Prototype

public static native JsDate create() ;

Source Link

Document

Creates a new date with the current time.

Usage

From source file:com.ait.toolkit.sencha.touch.ux.touchcalendar.client.core.nativepeers.NativeTouchCalendar.java

License:Open Source License

public static NativeTouchCalendar create(Store store, CalendarEventType type) {
    return new NativeTouchCalendar(_createNativePeer(store.getJsObj(), type.getValue(), JsDate.create(), ""));
}

From source file:com.ait.toolkit.sencha.touch.ux.touchcalendar.client.core.nativepeers.NativeTouchCalendar.java

License:Open Source License

public static NativeTouchCalendar create(Store store, CalendarEventType type, String eventTemplate) {
    return new NativeTouchCalendar(
            _createNativePeer(store.getJsObj(), type.getValue(), JsDate.create(), eventTemplate));
}

From source file:com.eduworks.gwt.client.net.api.FLRApi.java

License:Apache License

private static FLRPacket buildActivityProperties0(FLRRecord ap, ESBPacket feedback, String type) {
    JsDate date = JsDate.create();
    String dateStr = getISOdate0(date);
    FLRPacket fp = new FLRPacket();

    // Describe the actor
    FLRPacket actor = new FLRPacket();
    actor.put("objectType", "community");
    JSONArray ja = new JSONArray();
    ja.set(0, new JSONString("ADL RUSSEL user community"));
    actor.put("description", ja);
    fp.put("actor", actor);

    // Describe the verb (activity)
    //TODO fix FLR
    //      if (type == FLR_ACTIVITY_RATINGS) {
    //         FLRPacket payload = new FLRPacket();
    //         payload.put("avg", feedback.getAverageRating());
    //         payload.put("scale min", "1");
    //         payload.put("scale max", "5");
    //         payload.put("sample size", feedback.getRatingCount());
    //         FLRPacket value = new FLRPacket();
    //         value.put("measureType", "star average");
    //         value.put("value", payload);
    //         FLRPacket measure = new FLRPacket();
    //         measure.put("action", "rated");
    //         measure.put("measure", value);
    //         measure.put("context", "repository");      
    //         measure.put("date", ap.getCreateDate() + "/" + dateStr.substring(0, dateStr.indexOf('T')));   
    //         fp.put("verb", measure);
    //         fp.put("content", feedback.getRatingCount() + " member(s) of the ADL RUSSEL user community gave '"+ap.getTitle()+"' a rating of "+ feedback.getAverageRating() + " out of 5 stars");
    //      }/*from  w ww.  j  a va  2  s.  c om*/
    //      else if (type == FLR_ACTIVITY_COMMENTS) {
    //         FLRPacket payload = new FLRPacket();
    //         payload.put("measureType", "count");
    //         payload.put("value", feedback.getCommentCount());
    //         FLRPacket measure = new FLRPacket();
    //         measure.put("action", "commented");
    //         measure.put("measure", payload);      
    //         measure.put("date", ap.getCreateDate() + "/" + dateStr.substring(0, dateStr.indexOf('T')));   
    //         measure.put("context", "ADL RUSSEL repository");
    //         fp.put("verb", measure);
    //         fp.put("content", feedback.getCommentCount() + " member(s) of the ADL RUSSEL user community commented on '"+ap.getTitle()+"'.");
    //      }
    //      else if (type == FLR_ACTIVITY_ISD) {
    //         FLRPacket payload = new FLRPacket();
    //         payload.put("measureType", "count");
    //         payload.put("value", feedback.getString("count"));
    //         FLRPacket measure = new FLRPacket();
    //         measure.put("action", "aligned");
    //         measure.put("measure", payload);      
    //         measure.put("date", ap.getCreateDate() + "/" + dateStr.substring(0, dateStr.indexOf('T')));   
    //         measure.put("context", feedback.getString("template")+" instructional strategy");
    //         fp.put("verb", measure);
    //         FLRPacket object = new FLRPacket();
    //         object.put("objectType", "Instructional Strategy");
    //         object.put("description", feedback.getString("strategy"));
    //         ja = new JSONArray();
    //         ja.set(0, object);
    //         fp.put("related", ja);
    //         fp.put("content", "'"+ap.getTitle() + "' has been aligned with the '"+feedback.getString("strategy")+"' part of the '"+ feedback.getString("template") + "' template "+feedback.getString("count")+" time(s).");
    //      }
    //      
    //      // Describe the object
    //      FLRPacket object = new FLRPacket();
    //      object.put("objectType", "resource");
    //      if (ap.getRusselValue("russel:FLRid") != null) {
    //         object.put("id", ap.getRusselValue("russel:FLRtag"));   
    //      } else {
    //         object.put("id", CommunicationHub.siteURL+"?id="+ap.getNodeId());   
    //      }
    //      fp.put("object", object);
    //
    //      if (ap.getRusselValue("russel:FLRid") != null) {
    //         object = new FLRPacket();
    //         object.put("objectType", "comment");
    //         object.put("id", CommunicationHub.siteURL+"?id="+ap.getNodeId());
    //         ja = new JSONArray();
    //         ja.set(0, object);
    //         fp.put("related", ja);
    //      }

    return fp;
}

From source file:com.eduworks.gwt.client.net.api.FLRApi.java

License:Apache License

public static String buildFLRResourceDataDescription(ESBPacket ap) {
    JsDate date = JsDate.create();
    //TODO fix FLR
    //      FLRPacket fpRdd = new FLRPacket();
    //      fpRdd.put("doc_type", "resource_data");
    //      fpRdd.put("resource_data_type", "metadata");      
    //      fpRdd.put("node_timestamp", getISOdate0(date));   
    //      fpRdd.put("TOS", FLRPacket.makePacketTOS());   
    //      fpRdd.put("payload_placement", "inline");
    //      JSONArray ja = new JSONArray();
    //      ja.set(0, new JSONString("NSDL DC 1.02.020"));
    //      fpRdd.put("payload_schema", ja);   
    //      fpRdd.put("payload_schema_locator", "http://ns.nsdl.org/schemas/nsdl_dc/nsdl_dc_v1.02.xsd");
    //      fpRdd.put("active", true);   
    //      fpRdd.put("doc_version", "0.23.0");   
    //      fpRdd.put("resource_locator", CommunicationHub.siteURL+"?id="+ap.getNodeId());   
    //      fpRdd.put("publishing_node", "RUSSEL");
    //      fpRdd.put("identity", FLRPacket.makePacketIdentity(ap.getPublisher()));
    //      fpRdd.put("resource_data", buildNsdlDcRecord0(ap));  

    //return fpRdd.toString();
    return null;/*from  w w  w.java 2 s  .  c  o m*/
}

From source file:com.eduworks.gwt.client.net.api.FLRApi.java

License:Apache License

public static String buildFLRResourceDataActivity(FLRRecord ap, ESBPacket feedback, String type) {
    JsDate date = JsDate.create();

    //TODO fix FLR
    FLRPacket fpRdd = new FLRPacket();
    fpRdd.put("doc_type", "resource_data");
    fpRdd.put("resource_data_type", "paradata"); // assertion?
    fpRdd.put("active", true);
    fpRdd.put("node_timestamp", getISOdate0(date));
    fpRdd.put("create_timestamp", getISOdate0(date));
    fpRdd.put("TOS", FLRPacket.makePacketTOS());
    fpRdd.put("payload_placement", "inline");
    JSONArray ja = new JSONArray();
    ja.set(0, new JSONString("LR Paradata 1.0"));
    fpRdd.put("payload_schema", ja);
    fpRdd.put("doc_version", "0.23.0");
    fpRdd.put("resource_locator", CommunicationHub.siteURL + "?id=" + ap.getGuid());
    fpRdd.put("publishing_node", "RUSSEL");
    fpRdd.put("identity", FLRPacket.makePacketIdentity(ap.getPublisher()));
    fpRdd.put("resource_data", buildActivityRecord0(ap, feedback, type));

    return fpRdd.toString();
}

From source file:java.util.Date.java

License:Apache License

public Date() {
    jsdate = JsDate.create();
}

From source file:java.util.Date.java

License:Apache License

public Date(int year, int month, int date, int hrs, int min, int sec) {
    jsdate = JsDate.create();
    jsdate.setFullYear(year + 1900, month, date);
    jsdate.setHours(hrs, min, sec, 0);/* ww w  . ja  v  a  2 s  .  co  m*/
    fixDaylightSavings(hrs);
}

From source file:org.jdna.eloaa.client.application.newreleases.NewReleasesView.java

License:Apache License

public void doSearch() {
    if (year == 0) {
        year = JsDate.create().getFullYear();
    }//from  ww  w .  j a v  a2s . co  m
    if (month == 0) {
        month = JsDate.create().getMonth() + 1;
    }

    GWT.log("Searching: " + year + ", " + month);

    searchContainerInner.clear();
    searchProgress.setVisible(true);
    EloaaService.Instance.get().newReleases(year, month, new AsyncCallback<GResponse<List<GMovie>>>() {
        @Override
        public void onFailure(Throwable caught) {
            MaterialToast.fireToast("Search Failed: " + caught.getMessage());
        }

        @Override
        public void onSuccess(GResponse<List<GMovie>> result) {
            try {
                searchProgress.setVisible(false);
                if (result.isOK()) {
                    Date now = new Date();
                    int month = now.getMonth();
                    int day = now.getDate();
                    Widget w = null;
                    boolean scrolled = false;
                    for (GMovie m : result.get()) {
                        w = new MovieResult(m);
                        searchContainerInner.add(w);
                        if (!scrolled) {
                            if (m.getReleaseDate() != null) {
                                if (m.getReleaseDate().getMonth() == month
                                        && Math.abs(m.getReleaseDate().getDate() - day) < 7) {
                                    w.getElement().scrollIntoView();
                                    scrolled = true;
                                }
                            }
                        }
                    }
                    if (result.get().size() == 0) {
                        MaterialToast.fireToast("No new releases");
                    }
                }
            } catch (Throwable t) {
                t.printStackTrace();
                GWT.log("ERROR", t);
            }
        }
    });
}