File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 86
86
years < 1.5 && substitute ( $l . year , 1 ) ||
87
87
substitute ( $l . years , Math . round ( years ) ) ;
88
88
89
- var separator = $l . wordSeparator === undefined ? " " : $l . wordSeparator ;
89
+ switch ( $l . wordSeparator ) {
90
+ case undefined :
91
+ var separator = " " ;
92
+ break ;
93
+ case null :
94
+ var separator = "" ;
95
+ break ;
96
+ default :
97
+ var separator = $l . wordSeparator ;
98
+ }
90
99
return $ . trim ( [ prefix , words , suffix ] . join ( separator ) ) ;
91
100
} ,
92
101
parse : function ( iso8601 ) {
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ <h2>Settings</h2>
139
139
< li > < abbr id ="testYoungOldSettings2 " class ="toyoungold " title ="2018304000 "> </ abbr > [23360 days]</ li >
140
140
141
141
< li > < abbr id ="testNoSpaces1 " class ="nospaces " title ="120 "> </ abbr > [120 sec]</ li >
142
+ < li > < abbr id ="testNullSpaces1 " class ="nullspaces " title ="120 "> </ abbr > [120 sec]</ li >
142
143
143
144
< li > < abbr id ="testLatinSettings1 " class ="tolatin " title ="-7200 "> </ abbr > [-120 min]</ li >
144
145
< li > < abbr id ="testLatinSettings2 " class ="tolatin " title ="-60 "> </ abbr > [-60 sec]</ li >
@@ -243,6 +244,9 @@ <h2>Settings</h2>
243
244
loadNoSpaces ( ) ;
244
245
$ ( "abbr.nospaces" ) . each ( toWords ) ;
245
246
247
+ loadNullSpaces ( ) ;
248
+ $ ( "abbr.nullspaces" ) . each ( toWords ) ;
249
+
246
250
loadPigLatin ( ) ;
247
251
$ ( "abbr.tolatin" ) . each ( toWords ) ;
248
252
@@ -562,6 +566,7 @@ <h2>Settings</h2>
562
566
563
567
test ( "wordSeparator" , function ( ) {
564
568
ok ( $ ( "#testNoSpaces1" ) . html ( ) . match ( / ^ 2 m i n u t e s a g o $ / ) , "Settings correctly applied" ) ;
569
+ ok ( $ ( "#testNullSpaces1" ) . html ( ) . match ( / ^ 2 m i n u t e s a g o $ / ) , "Settings correctly applied" ) ;
565
570
} ) ;
566
571
} ) ( jQuery ) ;
567
572
//]]>
Original file line number Diff line number Diff line change @@ -102,6 +102,13 @@ function loadNoSpaces() {
102
102
} ) ;
103
103
}
104
104
105
+ function loadNullSpaces ( ) {
106
+ jQuery . extend ( jQuery . timeago . settings . strings , {
107
+ minutes : "%dminutes" ,
108
+ wordSeparator : null
109
+ } ) ;
110
+ }
111
+
105
112
function loadYoungOldYears ( ) {
106
113
jQuery . extend ( jQuery . timeago . settings . strings , {
107
114
years : function ( value ) { return ( value < 21 ) ? "%d young years" : "%d old years" ; }
You can’t perform that action at this time.
0 commit comments