JavaScript date figures into Chinese characters date format
Related Tags:
/ *
Features: YYYY-MM-DD date figures were translated into Chinese characters :1984-3 - 7 -> March 7, 1984 call: baodate2chinese ( "1984-3-7")
* /
Var chinese = [ 'zero' and 'one,' 'two' and 'three', 'four' and 'five' and 'six', 'Seven', 'eight', 'the'];
Var len = [ '10'];
Var ydm = [ 'the', 'on', 'the'];
Function num2chinese (s)
(
/ / Will be translated into Chinese single figures.
S = "" s;
Slen = s.length;
Var result = "";
For (var i = 0; i <slen; i)
(
Result = chinese [s.charAt (i)];
)
Return result;
)
Function n2c (s)
(
/ / Processing of the special circumstances.
S = "" s;
Var result = "";
If (s.length == 2)
(
If (s.charAt (0) == "1")
(
If (s.charAt (1) == "0") return len [0];
Return len chinese [0] [s.charAt (1)];
)
If (s.charAt (1) == "0") return chinese [s.charAt (0)] len [0];
Return chinese [s.charAt (0)] [0] chinese len [s.charAt (1)];
)
Return num2chinese (s)
)
Function baodate2chinese (s)
(
/ / Input Validation date format. Extraction and related figures.
Var datePat = / ^ (\ d (2) | \ d (4)) (\ /|-)( \ d (1,2)) (\ 2) (\ d (1,2 })$/;
Var matchArray = s.match (datePat);
Var ok = "";
If (matchArray == null) return false;
For (var i = 1; i <matchArray.length; i = i 2)
(
Ok = n2c (matchArray [i] -0) ydm [(i-1) / 2];
)
Return ok;
)
</ Script>
YYYY-MM-DD: <input type=text name="mydate" value="1984-3-7">
Chinese Show: <input type = text name = "okdate">
<Input type = button onclick = "= baodate2chinese document.all.okdate.value (document.all.mydate.value)"
Value = "conversion">
- CSS intensive manual 4
- Css Manual (6) List List
- CSS intensive manual (3)
- CSS intensive manual (4)
- Css Manual (2) [Text
- CSS quick Manual 3
- CSS development manual
- Css Manual (7) Classification Classification
- CSS intensive manual (2)
- All commonly used language reference manual for manual HTML | CSS manuals | JScript Manual | VbScript Manual | ASP Manual | PHP Manual | SQL manual | Site effects | ADO Manual
- Css intensive manual (1)
- Css Manual (1) Background Background
- CSS intensive manual 2
- CSS quick Manual 1
- CSS Development Manual [Author: nilxin]
- CSS intensive manual (5)
- Css Manual (c) Font font
- Chinese typesetting experience CSS
- CSS intensive manual (7)
- CSS Manual (4) Border Border
On the final words Web2.0

Recently Web2.0 and communities, many of these sites to the media about an interview. I think that there are people interested in this topic, simply here to own a few basic points write, save everyone's time, but also to save their own to speak about her spitting said. ...
The use of the CSS float

Today, the use of learning float to the vague concept of the original very clear, we provided to a web site, here are step-by-step Tutorial help you learn some use. Aggregate points clear on the use of 1. The use of float, the number of div row togethe...
Super-simple flash asp access Counter

Although the counter does not necessarily use the database, but I really counter this very, very simple Guoy_8186 is subject to the most inspired, he will vote Guide really very good. Flash code: Var count = new LoadVars (); / / create an object load...
CSS alternative forms of the classic examples

<DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Transitional / / EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html Xmlns=" http://www.w3.org/1999/xhtml "lang="gb2312"> <head> <meta ...
CSS solution with the difference between IE and Firefox

In IE and other (Mozilla, Opera, etc.), the browser will often show the effect of deviations 2 px. This is IE6.0 on the box to explain the distance between the Bug, we can use! Important to solve this problem, ! CSS1 important is the definition of grammar, sty...