~ubuntu-branches/ubuntu/karmic/tellico/karmic

« back to all changes in this revision

Viewing changes to src/field.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Regis Boudin
  • Date: 2008-05-23 21:28:59 UTC
  • mfrom: (0.1.14 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20080523212859-n0gl4ap37xb0uj1a
Tags: 1.3.2-1
* New upstream release.
* Recommend khelpcenter for acces to the help (Closes: #478975).

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
QString Field::formatDate(const QString& date_) {
361
361
  // internally, this is "year-month-day"
362
362
  // any of the three may be empty
363
 
  // but not all three, which might be the case when a nonsense string happens
 
363
  // if they're not digits, return the original string
364
364
  bool empty = true;
365
365
  // for empty year, use current
366
366
  // for empty month or date, use 1
385
385
    d = 1;
386
386
  }
387
387
  // rather use ISO date formatting than locale formatting for now. Primarily, it makes sorting just work.
388
 
  return empty ? QString() : QDate(y, m, d).toString(Qt::ISODate);
 
388
  return empty ? date_ : QDate(y, m, d).toString(Qt::ISODate);
389
389
  // use short form
390
390
//  return KGlobal::locale()->formatDate(date, true);
391
391
}
560
560
    if(!ok) {
561
561
      return; // no need to convert
562
562
    }
563
 
    min = KMIN(min, n);
564
 
    max = KMAX(max, n);
 
563
    min = QMIN(min, n);
 
564
    max = QMAX(max, n);
565
565
  }
566
 
  max = KMIN(max, 10);
 
566
  max = QMIN(max, 10);
567
567
  if(min >= max) {
568
568
    min = 1;
569
569
    max = 5;