At first i tried this with the Calender-Class but then i read, that it is not supported by GWT. Do you have suggestions? Thank you in advance.
Since GWT 2.7 you can use JsDate.
Yes, you should use the deprecated Date API. You should probably create a utility class for such date manipulation, something like CalendarUtil, but for hours/minutes. If Calendar (or any alternative) is every ported to GWT (or a date time library surfaces that is actually maintained), you can change the implementation in your utility class and the rest of your application will remain the same.
Related
I am currently developing an application with Flutter where I use the Google Maps API but I am having a problem with the display of data.
Indeed in my application it displays the arrival time (arrival_time) like this: 7:19pm.
But I would like it to display in this form: 19:19
Same for the travel time (duration) it displays 1hour24mins but I would like it to display 1h24.
How do I deal with these problems?
Thanks a lot for your help
Cordially
Thibault
Here is a screenshot:
If you can transform this dates to DateTime, then you could use intl package to transform the time.
For instance:
DateTime t = DateTime.now();
print(DateFormat.Hm().format(t));
This prints the time in 24 hours format.
You would also probably be able to also transform it to XhYm too.
Thanks a lot for your help.
So there you have it, I tried your solutions but it doesn't work.
What is strange is that when I call the API with a browser (Chrome) it displays the correct time (16:48).
But when I try in the app it returns 4:48 pm.
And suddenly I don't know how to solve this problem.
So if there are any additional parameters to pass, I would like to have them.
Thank you for your time
Cordially
Thibault
I want to use datepicker in jHipster v4.8.2 project with Angular 4. I tried this answer
but it didn't work. I would be thankful if you have an idea.
As mentioned here you can use NgbTimepicker on "Instant" (= a java.time.Instant object), which jhipster.tech recommends to be most probably used instead of a "ZonedDateTime" (see Field types), or use the PrimeNG support - here you can see a code example in detail.
You can also find my PrimeNG calendar-module implementation here - trying to get the example app from Full Stack Development with JHipster done.
Is there a decent date picker (like jQuery UI) that works in Foundation 4? I tried http://foundation-datepicker.peterbeno.com/example/example.html but that doesn't work. And since Foundation 4 wants to use Zepto.js over jQuery, jQuery UI won't load for me.
You can use my port of bootstrap datepicker:
http://foundation-datepicker.peterbeno.com/
https://github.com/najlepsiwebdesigner/foundation-datepicker
We've got full support for foundation 5, (f4 release available), multiple languages available.
Hope it helps! :)
you can just force foundation 4 to only load jquery by default only by changing:
<script>
document.write('<script src=' +
('__proto__' in {} ? 'javascripts/vendor/zepto' : 'javascripts/vendor/jquery') +
'.js><\/script>')
</script>
to
<script src="javascripts/vendor/jquery.js"></script>
or your favorite cdn then go crazy with jquery ui, after you include that as well of course.
I built an interface for Date and Time picking for Foundation. It's a little fresh, but my company has been using it on a production site and it's holding up.
https://github.com/jockmac22/foundation_calendar_date_time_picker
It supports custom date, time and field value formats so you can have a user friendly display of the date and time, with an ISO standard (or any other format) as the final value stored in the field.
I'll admit that I have no idea how it will work with Zepto, but let me know your thoughts if you decide to try it.
I am working on a BlackBerry application and I need a way to find out the millis value of tomorrow morning at 1am. On Android, this would a job for Calendar.add(), or Calendar.roll(). But the Calendar class in BlackBerry doesn't seem to have either of these methods. Is my only option to do the arithmetic on millis values?
Take a look at DateTimeUtilities, specifically getNextDate(). I think that you can probably get it to do what you need with that.
http://www.blackberry.com/developers/docs/5.0.0api/index.html
I have seen that GWT framework is having generator feature.
In what case we have to use gwt generator option and why it is needed?
Can anyone tell me simply why,what is gwt generator? Done some googling. But not much helpful stuffs...
From this tutorial:
Generators allow the GWT coder to generate Java code at compile time and have it then be compiled along with the rest of the project into JavaScript.
This tutorial uses the example of generating a Map of values at compile time based on a properties file.
I've done GWT development for 3 years now and I've written one generator :) I've written a couple of linkers for experimental purposes so I think they are more common, though still rare. The classic case is where you want to write
X x = GWT.create(X.class)
and have the particular subclass or implementation of X constructed at compile time based on, perhaps, annotations in the provided X class or interface. GWT uses them for things like the CSSResource.
Search for "GWT Generator Experiments" site:development.lombardi.com on google for some info about what I did.
One of the use cases is to mimic reflection on the client side by building a factory class on the fly. I remember answering a question posted by you earlier on how to do this
How to create new instance from class name in gwt?
So i guess you already know the application. What else are you looking for? Can you be precise?
I've started using GWT Generators where I needed Java Reflection. I've documented One of the use cases for using GWT generators here:
http://jpereira.eu/2011/01/30/wheres-my-java-reflection/
Hope it helps.
If you refer to code generator, yes, there will a tool supporting GWT 2.1 code generation. For more details and a quick start, see http://www.springsource.org/roo/start
A general roo intro is here http://blog.springsource.com/2009/05/01/roo-part-1/
Another visual tutorial is at http://www.thescreencast.com/2010/05/how-to-gwt-roo.html
Check out this implementation:
http://samuelschmid.blogspot.com/2012/05/using-generator-for-generic-class.html
You can create new Instances of classes on client with foo.newInstance("fully.qualified.class.name");