Dojo Calendar is only showing numbers instead of month names - calendar

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).

Related

Set default date for zul datebox

I inherited a legacy website written in old zul and have to add new datebox component for birthday datepicker.
Have added a constraint to accept dates before a given date but that triggers an error alertbox from start as the date presented/selected by default on the datepicker is today.
I wouldn't want to use a workaround but to all due respect it seems like this is something over the top feature I'm looking for in zk's reality:
The main showcase for zul does include a birthday datebox, but pretty lame as it doesn't contain any constrain on age.
There is zk fiddler to show how the before constrain works, but that just proves my point that it doesn't select the first proper date for default date at least, if there is no clean way of setting it.
There is forum post that proposes a workaround to set the default year, so Zk is most probably incapable of doing this without a workaround.
There is an open ZK Jira issue from 2017 that addresses somewhat this issue, with a proposed solution pretty much the same as the workaround mentioned in the above point - so the hope is kinda lost, have to go on the workaround route.
I did try that workaround (after the forum post, as that has default year), but the workaround doesn't work for me. It does execute the
this.setValue(initialDate);
And I see that the value is set into the datebox's _pop/_value and _pop/_end nodes but no difference is visible on the datepicker box, still today is preselected altough it is greyed out - so no effect.
Still, when I try it in a fiddle with version 6.5.8.1, the oldest engine that exists, it does work, but not locally with v5.0.11.
In the buglist for this version there is no mention of datebox. Tried to look into to some bugs that might be interfering but turns out it was just another episode of me wasting time with this.
Tried in the 5.0.11 sandbox and it doesnt work with that version. The structure of how I use it is imitated in the linked fiddler. Hints on a workaround that works on this version?
ZK 5.0.11 is a bit on the older side currently, so it might not accept exactly the same overrides as later versions. If I understand the issue correctly, it boils down to either
1 - setting a value before Datebox is rendered to have a "initial date" opened in calendar.
I'd say that's the easy way out, since you can use either composing or databinding to set the value of the datebox during page rendering. Here's a small sample using databinding and zscripts, but the same logic should apply from composer with setValue(). You mentioned that this doesn't work for you locally with 5.0.11 though. Can you share the code that you are using for this? Sample code here in fiddle I can run it on local 5.0.11, and it set the date before popup is opened.
or
2 - setting an initial date (which doesn't affect the selected value) but would be the target for the opened calendar.
This is not a default ZK 5 behavior for datebox. If you want that effect, you would need to customize it using an override script. Simplest way in can think of in ZK 5 is to use the open event of the datebox popup here's an example of what it would look like (package in a script tag in a single page for the example, would use a global js file for real deployement) example here

react-intl display currency symbol only

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. :)

Dynamic exposed filters in Drupal 7

I've got a question in drupal. I have two filters. The values of the 2nd filter depends on what value was chosen in the first filter.
Example.
First filter values : Lakers,Clippers
Second filter values : if Lakers was chosen = KOBE,GASOL
if Clippers was chosen = PAUL,GRIFFIN .
Is there any module that supports this? Or do I have to code this? If I do is there any reference or guide that I could read and follow?
THANKS!
Yes there is
Drupal has a module called hierarchical select.
check this out
https://drupal.org/project/hierarchical_select.
Hope this helps you.
Don't use hierachical select. It is chock full of bugs and since the maintainer went to work for Acquia, he no longer pays any attention to it. You'll have to write some code to make this work using contextual filters.

regex for time 24 hour format in extjs 3

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

How to get city code weather in AccuWeather?

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

Resources