(trunk) #3698 "creation date of magnet links are set before the epoch." -- fixed.

This commit is contained in:
Charles Kerr 2010-11-08 19:16:03 +00:00
parent 130b52ce93
commit ffe54a20ed
3 changed files with 11 additions and 2 deletions

View File

@ -605,6 +605,10 @@ get_short_date_string( time_t t )
{
char buf[64];
struct tm tm;
if( !t )
return g_strdup( _( "N/A" ) );
tr_localtime_r( &t, &tm );
strftime( buf, sizeof( buf ), "%d %b %Y", &tm );
return g_locale_to_utf8( buf, -1, NULL, NULL, NULL );

View File

@ -619,10 +619,12 @@ Details :: refresh( )
}
if( mixed_creator && mixed_date )
string = mixed;
else if( mixed_date )
else if( mixed_date && !creator.isEmpty())
string = tr( "Created by %1" ).arg( creator );
else if( mixed_creator || creator.isEmpty( ) )
else if( mixed_creator && !date.isEmpty())
string = tr( "Created on %1" ).arg( date );
else if( creator.isEmpty() && date.isEmpty())
string = tr( "N/A" );
else
string = tr( "Created by %1 on %2" ).arg( creator ).arg( date );
}

View File

@ -210,6 +210,9 @@ Transmission.fmt = (function()
timestamp: function( seconds )
{
if( !seconds )
return 'N/A';
var myDate = new Date(seconds*1000);
var now = new Date();