rahulpathakgit / codeswarm

Automatically exported from code.google.com/p/codeswarm
GNU General Public License v3.0
0 stars 0 forks source link

Date-Issue, possible solution #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I think you can leave out the Date-conversion in the python-script and put
it into the processing file:

In convert_logs.py:
line 86: comment out the conversions, leave date as it is, delete the
conversions
date = datetime.strptime(date, '%Y-%m-%d %H:%M:%S')

In code_swarm.pde:
line 442: change
void loadRepEvents( String filename1 )
{
  XMLElement doc = new XMLElement( this, filename1 );

  // <--
  for( int i = 0; i < doc.getChildCount(); i++ )
  {
    XMLElement xml = doc.getChild(i);
    String filename = xml.getStringAttribute( "filename" );
    String datestr = xml.getStringAttribute( "date" );
    long date = Long.parseLong( datestr ); // <--
   [...]

to

void loadRepEvents( String filename1 )
{
  XMLElement doc = new XMLElement( this, filename1 );
  java.text.SimpleDateFormat format = new
java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // <--
  for( int i = 0; i < doc.getChildCount(); i++ )
  {
    XMLElement xml = doc.getChild(i);
    String filename = xml.getStringAttribute( "filename" );
    String datestr = xml.getStringAttribute( "date" );
   long date = format.parse(datestr, new java.text.ParsePosition(0)
).getTime(); // <--

it worked fine for me

Original issue reported on code.google.com by Roland.K...@gmail.com on 26 Jun 2008 at 11:33

GoogleCodeExporter commented 8 years ago
Not a defect. Format conversions should be handled by the conversion scripts.

Original comment by michael....@gmail.com on 27 Jun 2008 at 3:09