         oldest = undefined
         for x in patches
             if x?
+                if not misc.is_date(x.time)
+                    # ensure that time is not a string representation of a time
+                    x.time = new Date(x.time)
                 t   = x.time - 0
                 cur = @_times[t]
                 if cur?

    has_uncommitted_changes: () =>
        return @_patches_table?.has_uncommitted_changes()

# A simple example of a document.  Uses this one by default
# if nothing explicitly passed in for doc in SyncString constructor.
class StringDocument

        if not x?  # we allow for x itself to not be defined since that simplifies other code
            return
        time    = x.get('time')
        if not misc.is_date(time)
            time = new Date(time)
        user_id = x.get('user_id')
        sent    = x.get('sent')
        prev    = x.get('prev')
