File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -855,7 +855,7 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
855
855
parse_type( 'S' , tm) )
856
856
}
857
857
't' => ~"\t ",
858
- // 'U' {}
858
+ 'U' => format ! ( "{:02d}" , ( tm . tm_yday - tm . tm_wday + 7 ) / 7 ) ,
859
859
'u' => {
860
860
let i = tm. tm_wday as int ;
861
861
( if i == 0 { 7 } else { i } ) . to_str ( )
@@ -1240,7 +1240,7 @@ mod tests {
1240
1240
assert_eq!(local.strftime(" %s"), ~" 1234567890 ");
1241
1241
assert_eq!(local.strftime(" %T "), ~" 15 : 31 : 30 ");
1242
1242
assert_eq!(local.strftime(" %t"), ~"\t " ) ;
1243
- // assert !(local.strftime("%U") == "06");
1243
+ assert_eq ! ( local. strftime( "%U" ) , ~ "06 ");
1244
1244
assert_eq!(local.strftime(" %u"), ~" 5 ");
1245
1245
// assert!(local.strftime(" %V ") == " 07 ");
1246
1246
assert_eq!(local.strftime(" %v"), ~" 13 -Feb -2009 ");
You can’t perform that action at this time.
0 commit comments