1. 06 5月, 2011 3 次提交
  2. 05 5月, 2011 12 次提交
  3. 30 4月, 2011 3 次提交
  4. 27 4月, 2011 1 次提交
  5. 24 4月, 2011 1 次提交
  6. 21 4月, 2011 1 次提交
    • M
      date: avoid "X years, 12 months" in relative dates · f1e9c548
      Michael J Gruber 提交于
      When relative dates are more than about a year ago, we start
      writing them as "Y years, M months".  At the point where we
      calculate Y and M, we have the time delta specified as a
      number of days. We calculate these integers as:
      
        Y = days / 365
        M = (days % 365 + 15) / 30
      
      This rounds days in the latter half of a month up to the
      nearest month, so that day 16 is "1 month" (or day 381 is "1
      year, 1 month").
      
      We don't round the year at all, though, meaning we can end
      up with "1 year, 12 months", which is silly; it should just
      be "2 years".
      
      Implement this differently with months of size
      
        onemonth = 365/12
      
      so that
      
        totalmonths = (long)( (days + onemonth/2)/onemonth )
        years = totalmonths / 12
        months = totalmonths % 12
      
      In order to do this without floats, we write the first formula as
      
        totalmonths = (days*12*2 + 365) / (365*2)
      
      Tests and inspiration by Jeff King.
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f1e9c548
  7. 20 4月, 2011 4 次提交
  8. 19 4月, 2011 1 次提交
  9. 15 4月, 2011 4 次提交
  10. 14 4月, 2011 6 次提交
  11. 13 4月, 2011 1 次提交
  12. 12 4月, 2011 3 次提交