I am little weak in regular expression. Can anybody help me in finding regular expression for time (in 24 hour format) in extjs
Thank you.
Don't reinvent the wheel if you don't have to. The fine folks at Sencha went through a lot of trouble so that developers like us don't have to mess with this sort of thing.
// returns null if parse failed, or Date object is successful
var mydate = Ext.Date.parse(inputString, "G:i");
For more information, check the API docs for Ext.Date
This might be what you are looking for:
'/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/'
Not sure if it works on extis, if not you can always translate it back to the syntax uses in extis.
Try out
^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$
or you can use
([01]?[0-9]|2[0-3]):[0-5][0-9]
For more info visit tutorial
Related
Working with react-intl and was looking to display a currency symbol only, after some text like USD$.
From what I have read so far in the documentation guessing FormattedNumber requires a default value.
Just wondering is it possible to display a currency symbol without a number value? such as $ (currently it returns NaN, due to missing number value)
Wondering has anyone run into this kind of issue previously?
Guessing there must be a simple solution.
In the meantime will keep looking for alternative solutions.
Any thought greatly appreciated.
Wasn't able to find a solution with react-intl.
So created simple helper to do the job.
Works ok. :)
This is my first post here, so I'm sorry if I'm not in the good section.
My "simple" question is, can we add a gage/gauge (I don't now the exact english spelling), in a Ionic project ?
A thing like that:
https://www.youtube.com/watch?v=w2qrYL0Le24
Or an other exemple:
http://crisbeto.github.io/angular-svg-round-progressbar/
I already tried to insert gauge like that in my project but the gauge never appears, so please, can you help me ?
(The goal is to show to an user a speed for exemple or the batterie life of his smartphone, any importance, juste a jauge who can be incremented or decremented)
Can you explain me please how it works, for example via a Codepen or anything else. I had already tried to search response but I solve anything on that.
I'm french and I am sorry for my language, but thanks in advance for you'r help !
Thanks.
I was able to get this to work:
https://github.com/frapontillo/angular-gage
You must also have the JustGage library and Raphael. Take a look at the example to see it in action. I was able to even make it work in the http://creator.ionic.io app by adding the scripts of angular-gage, JustGage and Raphael (just add a js and paste in the scripts).
I currently have a problem with Dojo's calendar. It doesn't seem to be showing the name of the month when the locale is switched to zh-tw.
Instead of getting:
一月
二月
三月
。。。
we get
1
2
3
...
We don't have this problem when Dojo the locale is set to en. This is somewhat related to https://bugs.dojotoolkit.org/ticket/10490.
Anyone have a clue as to how to fix this? :)
Thanks!
That's because they implemented it that way. You can look at the source code and see that the months are numbered. You can even compare it to the English version.
As far as I know there is no way to extend or override this, so you will have to extend the dijit.Calendar._MonthDropDown yourself and hardcode it (not that this is a best practice).
Have someone ever use AccuWeather to search your country weather? I want to get my city weather code in AccuWeather who can help me? The code generate has form like this: EUR|DE|GM014|TORGAU. I can't find my city code (Phnom Penh, Cambodia)
to find your location
use this link provided by the help in ubuntu
http://thale.accu-weather.com/widget/thale/city-find.asp?location=
add your location at the end of the link
http://thale.accu-weather.com/widget/thale/city-find.asp?location=PARIS
For Phnom Penh, the code you seek is ASI|KH|CB012|PHNOM PENH.
Now in general, getting that old style format is difficult because around the end of 2009 / beginning of 2010 they did away with that style of coding stations and replaced it with a newer, perhaps more friendly model. So new style,
http://www.accuweather.com/en/kh/phnom-penh/49785/weather-forecast/49785
will give you the current for Phnom Penh.
If you really really really need to find the old style codes, there is an awesome list here. I would recommend you download the list from here as it is gold at this point and then you can programmatically access it however you see fit. Regex would be a good bet as the format seems to be pretty consistent.
Find your (nearest) city here: http://pastebin.com/dbtemx5F
I would like to have a textfield, representing the amount of time of something, parse a text value like '3d 4h' into hours. The example I provide would be 3 days, 4 hours -- 76 hours.
Before I go off and roll my own text-to-number parser engine, has anyone done something like this before, or does Extj4 provide a way to ease this process?
Thanks!
I haven't seen this in JS.
You might get some inspiration looking at the source code for PHP's strtotime function, which does essentially what you are looking for:
https://github.com/php/php-src/blob/master/ext/date/php_date.c#L1324
Other options:
regex for textual dates? (aka source code for php's strtotime )