Changeset 952
- Timestamp:
- 05/28/08 13:32:35 (6 months ago)
- Files:
-
- branches/1.0.x/lib/jelix-www/js/jforms.js (modified) (7 diffs)
- branches/1.0.x/lib/jelix-www/js/jforms.js (modified) (7 diffs)
- branches/1.0.x/lib/jelix-www/js/jforms.js (modified) (7 diffs)
- branches/1.0.x/lib/jelix-www/js/jforms.js (modified) (7 diffs)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/lib/jelix-www/js/jforms.js
r698 r952 1 1 /** 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor 6 * @copyright 2007 Laurent Jouanneau 7 * @link http://www.jelix.org 8 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor Julien Issler 6 * @copyright 2007 Laurent Jouanneau 7 * @copyright 2008 Julien Issler 8 * @link http://www.jelix.org 9 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 9 10 */ 10 11 … … 87 88 break; 88 89 case 'datetime' : 89 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}) :(\d{2})$/);90 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})(:(\d{2}))?$/); 90 91 if(t == null){ ok=false; break; } 91 92 var yy = parseInt(t[1],10); … … 94 95 var th = parseInt(t[4],10); 95 96 var tm = parseInt(t[5],10); 96 var ts = parseInt(t[6],10); 97 var dt = new Date(yy,mm,dd,th,tn,ts); 97 var ts = 0; 98 if(t[7] != null) 99 ts = parseInt(t[7],10); 100 var dt = new Date(yy,mm,dd,th,tm,ts); 98 101 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 99 102 ok = false; … … 115 118 case 'localetime' : 116 119 case 'time' : 117 var t = val.match(/^(\d{2}):(\d{2}) :(\d{2})$/);120 var t = val.match(/^(\d{2}):(\d{2})(:(\d{2}))?$/); 118 121 if(t == null){ ok=false; break; } 119 var th = parseInt(t[4],10); 120 var tm = parseInt(t[5],10); 121 var ts = parseInt(t[6],10); 122 var dt = new Date(2007,05,02,th,tn,ts); 122 var th = parseInt(t[1],10); 123 var tm = parseInt(t[2],10); 124 var ts = 0; 125 if(t[4] != null) 126 ts = parseInt(t[4],10); 127 var dt = new Date(2007,05,02,th,tm,ts); 123 128 if(th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 124 129 ok = false; … … 129 134 var yy, mm, dd, th, tm, ts; 130 135 if(c.lang.indexOf('fr_') == 0) { 131 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);136 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 132 137 if(t == null){ ok=false; break; } 133 138 yy = parseInt(t[3],10); … … 136 141 th = parseInt(t[4],10); 137 142 tm = parseInt(t[5],10); 138 ts = parseInt(t[6],10); 143 ts = 0; 144 if(t[7] != null) 145 ts = parseInt(t[7],10); 139 146 }else{ 140 147 //default is en_* format 141 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);148 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 142 149 if(t == null){ ok=false; break; } 143 150 yy = parseInt(t[3],10); … … 146 153 th = parseInt(t[4],10); 147 154 tm = parseInt(t[5],10); 148 ts = parseInt(t[6],10); 155 ts = 0; 156 if(t[7] != null) 157 ts = parseInt(t[7],10); 149 158 } 150 var dt = new Date(yy,mm,dd,th,t n,ts);159 var dt = new Date(yy,mm,dd,th,tm,ts); 151 160 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 152 161 ok = false; branches/1.0.x/lib/jelix-www/js/jforms.js
r698 r952 1 1 /** 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor 6 * @copyright 2007 Laurent Jouanneau 7 * @link http://www.jelix.org 8 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor Julien Issler 6 * @copyright 2007 Laurent Jouanneau 7 * @copyright 2008 Julien Issler 8 * @link http://www.jelix.org 9 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 9 10 */ 10 11 … … 87 88 break; 88 89 case 'datetime' : 89 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}) :(\d{2})$/);90 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})(:(\d{2}))?$/); 90 91 if(t == null){ ok=false; break; } 91 92 var yy = parseInt(t[1],10); … … 94 95 var th = parseInt(t[4],10); 95 96 var tm = parseInt(t[5],10); 96 var ts = parseInt(t[6],10); 97 var dt = new Date(yy,mm,dd,th,tn,ts); 97 var ts = 0; 98 if(t[7] != null) 99 ts = parseInt(t[7],10); 100 var dt = new Date(yy,mm,dd,th,tm,ts); 98 101 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 99 102 ok = false; … … 115 118 case 'localetime' : 116 119 case 'time' : 117 var t = val.match(/^(\d{2}):(\d{2}) :(\d{2})$/);120 var t = val.match(/^(\d{2}):(\d{2})(:(\d{2}))?$/); 118 121 if(t == null){ ok=false; break; } 119 var th = parseInt(t[4],10); 120 var tm = parseInt(t[5],10); 121 var ts = parseInt(t[6],10); 122 var dt = new Date(2007,05,02,th,tn,ts); 122 var th = parseInt(t[1],10); 123 var tm = parseInt(t[2],10); 124 var ts = 0; 125 if(t[4] != null) 126 ts = parseInt(t[4],10); 127 var dt = new Date(2007,05,02,th,tm,ts); 123 128 if(th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 124 129 ok = false; … … 129 134 var yy, mm, dd, th, tm, ts; 130 135 if(c.lang.indexOf('fr_') == 0) { 131 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);136 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 132 137 if(t == null){ ok=false; break; } 133 138 yy = parseInt(t[3],10); … … 136 141 th = parseInt(t[4],10); 137 142 tm = parseInt(t[5],10); 138 ts = parseInt(t[6],10); 143 ts = 0; 144 if(t[7] != null) 145 ts = parseInt(t[7],10); 139 146 }else{ 140 147 //default is en_* format 141 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);148 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 142 149 if(t == null){ ok=false; break; } 143 150 yy = parseInt(t[3],10); … … 146 153 th = parseInt(t[4],10); 147 154 tm = parseInt(t[5],10); 148 ts = parseInt(t[6],10); 155 ts = 0; 156 if(t[7] != null) 157 ts = parseInt(t[7],10); 149 158 } 150 var dt = new Date(yy,mm,dd,th,t n,ts);159 var dt = new Date(yy,mm,dd,th,tm,ts); 151 160 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 152 161 ok = false; branches/1.0.x/lib/jelix-www/js/jforms.js
r698 r952 1 1 /** 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor 6 * @copyright 2007 Laurent Jouanneau 7 * @link http://www.jelix.org 8 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor Julien Issler 6 * @copyright 2007 Laurent Jouanneau 7 * @copyright 2008 Julien Issler 8 * @link http://www.jelix.org 9 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 9 10 */ 10 11 … … 87 88 break; 88 89 case 'datetime' : 89 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}) :(\d{2})$/);90 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})(:(\d{2}))?$/); 90 91 if(t == null){ ok=false; break; } 91 92 var yy = parseInt(t[1],10); … … 94 95 var th = parseInt(t[4],10); 95 96 var tm = parseInt(t[5],10); 96 var ts = parseInt(t[6],10); 97 var dt = new Date(yy,mm,dd,th,tn,ts); 97 var ts = 0; 98 if(t[7] != null) 99 ts = parseInt(t[7],10); 100 var dt = new Date(yy,mm,dd,th,tm,ts); 98 101 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 99 102 ok = false; … … 115 118 case 'localetime' : 116 119 case 'time' : 117 var t = val.match(/^(\d{2}):(\d{2}) :(\d{2})$/);120 var t = val.match(/^(\d{2}):(\d{2})(:(\d{2}))?$/); 118 121 if(t == null){ ok=false; break; } 119 var th = parseInt(t[4],10); 120 var tm = parseInt(t[5],10); 121 var ts = parseInt(t[6],10); 122 var dt = new Date(2007,05,02,th,tn,ts); 122 var th = parseInt(t[1],10); 123 var tm = parseInt(t[2],10); 124 var ts = 0; 125 if(t[4] != null) 126 ts = parseInt(t[4],10); 127 var dt = new Date(2007,05,02,th,tm,ts); 123 128 if(th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 124 129 ok = false; … … 129 134 var yy, mm, dd, th, tm, ts; 130 135 if(c.lang.indexOf('fr_') == 0) { 131 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);136 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 132 137 if(t == null){ ok=false; break; } 133 138 yy = parseInt(t[3],10); … … 136 141 th = parseInt(t[4],10); 137 142 tm = parseInt(t[5],10); 138 ts = parseInt(t[6],10); 143 ts = 0; 144 if(t[7] != null) 145 ts = parseInt(t[7],10); 139 146 }else{ 140 147 //default is en_* format 141 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);148 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 142 149 if(t == null){ ok=false; break; } 143 150 yy = parseInt(t[3],10); … … 146 153 th = parseInt(t[4],10); 147 154 tm = parseInt(t[5],10); 148 ts = parseInt(t[6],10); 155 ts = 0; 156 if(t[7] != null) 157 ts = parseInt(t[7],10); 149 158 } 150 var dt = new Date(yy,mm,dd,th,t n,ts);159 var dt = new Date(yy,mm,dd,th,tm,ts); 151 160 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 152 161 ok = false; branches/1.0.x/lib/jelix-www/js/jforms.js
r698 r952 1 1 /** 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor 6 * @copyright 2007 Laurent Jouanneau 7 * @link http://www.jelix.org 8 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 2 * @package jelix 3 * @subpackage forms 4 * @author Laurent Jouanneau 5 * @contributor Julien Issler 6 * @copyright 2007 Laurent Jouanneau 7 * @copyright 2008 Julien Issler 8 * @link http://www.jelix.org 9 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 9 10 */ 10 11 … … 87 88 break; 88 89 case 'datetime' : 89 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}) :(\d{2})$/);90 var t = val.match(/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})(:(\d{2}))?$/); 90 91 if(t == null){ ok=false; break; } 91 92 var yy = parseInt(t[1],10); … … 94 95 var th = parseInt(t[4],10); 95 96 var tm = parseInt(t[5],10); 96 var ts = parseInt(t[6],10); 97 var dt = new Date(yy,mm,dd,th,tn,ts); 97 var ts = 0; 98 if(t[7] != null) 99 ts = parseInt(t[7],10); 100 var dt = new Date(yy,mm,dd,th,tm,ts); 98 101 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 99 102 ok = false; … … 115 118 case 'localetime' : 116 119 case 'time' : 117 var t = val.match(/^(\d{2}):(\d{2}) :(\d{2})$/);120 var t = val.match(/^(\d{2}):(\d{2})(:(\d{2}))?$/); 118 121 if(t == null){ ok=false; break; } 119 var th = parseInt(t[4],10); 120 var tm = parseInt(t[5],10); 121 var ts = parseInt(t[6],10); 122 var dt = new Date(2007,05,02,th,tn,ts); 122 var th = parseInt(t[1],10); 123 var tm = parseInt(t[2],10); 124 var ts = 0; 125 if(t[4] != null) 126 ts = parseInt(t[4],10); 127 var dt = new Date(2007,05,02,th,tm,ts); 123 128 if(th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 124 129 ok = false; … … 129 134 var yy, mm, dd, th, tm, ts; 130 135 if(c.lang.indexOf('fr_') == 0) { 131 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);136 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 132 137 if(t == null){ ok=false; break; } 133 138 yy = parseInt(t[3],10); … … 136 141 th = parseInt(t[4],10); 137 142 tm = parseInt(t[5],10); 138 ts = parseInt(t[6],10); 143 ts = 0; 144 if(t[7] != null) 145 ts = parseInt(t[7],10); 139 146 }else{ 140 147 //default is en_* format 141 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2}) :(\d{2})$/);148 var t = val.match(/^(\d{2})\/(\d{2})\/(\d{4}) (\d{2}):(\d{2})(:(\d{2}))?$/); 142 149 if(t == null){ ok=false; break; } 143 150 yy = parseInt(t[3],10); … … 146 153 th = parseInt(t[4],10); 147 154 tm = parseInt(t[5],10); 148 ts = parseInt(t[6],10); 155 ts = 0; 156 if(t[7] != null) 157 ts = parseInt(t[7],10); 149 158 } 150 var dt = new Date(yy,mm,dd,th,t n,ts);159 var dt = new Date(yy,mm,dd,th,tm,ts); 151 160 if(yy != dt.getFullYear() || mm != dt.getMonth() || dd != dt.getDate() || th != dt.getHours() || tm != dt.getMinutes() || ts != dt.getSeconds()) 152 161 ok = false; branches/1.0.x/lib/jelix/CREDITS
r950 r952 75 75 - jDao : attribute groupby for method selectfirst (#447) 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 77 78 78 79 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r950 r952 75 75 - jDao : attribute groupby for method selectfirst (#447) 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 77 78 78 79 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r950 r952 75 75 - jDao : attribute groupby for method selectfirst (#447) 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 77 78 78 79 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r950 r952 75 75 - jDao : attribute groupby for method selectfirst (#447) 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 77 78 78 79 Bastien Jaillot (aka bastnic)
