- Timestamp:
- 02/15/08 18:30:26 (10 months ago)
- Files:
-
- 1 modified
-
lang/vim/calendar/calendar.vim (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/vim/calendar/calendar.vim
r3719 r6736 3 3 " File: calendar.vim 4 4 " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> 5 " Last Change: Wed, 25 Jul 20076 " Version: 1. 65 " Last Change: Fri, 15 Feb 2008 6 " Version: 1.7 7 7 " Thanks: 8 " Per Winkvist : bug fix 8 9 " Serge (gentoosiast) Koksharov : bug fix 9 10 " Vitor Antunes : bug fix … … 53 54 " show horizontal calendar ... 54 55 " ChangeLog: 56 " 1.7 : bug fix, week number was broken on 2008. 55 57 " 1.6 : added calendar_begin action. 56 58 " added calendar_end action. 57 59 " 1.5 : bug fix, fixed ruler formating with strpart. 58 60 " bug fix, using winfixheight. 59 " 1.4a : bug fix, week numbe nr was broken on 2005.61 " 1.4a : bug fix, week number was broken on 2005. 60 62 " added calendar_today action. 61 63 " bug fix, about wrapscan. … … 302 304 " GetLatestVimScripts: 52 1 :AutoInstall: calendar.vim 303 305 304 let g:calendar_version = "1. 6"306 let g:calendar_version = "1.7" 305 307 if &compatible 306 308 finish … … 504 506 "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 505 507 " remember today 506 " divide strftime('%d') by 1 so as to get "1, 2,3 .. 9" instead of "01, 02, 03 .. 09"508 " divide strftime('%d') by 1 so as to get "1,2,3 .. 9" instead of "01, 02, 03 .. 09" 507 509 let vtoday = strftime('%Y').strftime('%m').strftime('%d') 508 510 … … 557 559 if vmnth == 1 558 560 let vmdays = 31 559 let vparam = 0561 let vparam = 1 560 562 let vsmnth = 'Jan' 561 563 elseif vmnth == 2 562 564 let vmdays = 28 563 let vparam = 3 1565 let vparam = 32 564 566 let vsmnth = 'Feb' 565 567 elseif vmnth == 3 566 568 let vmdays = 31 567 let vparam = 59569 let vparam = 60 568 570 let vsmnth = 'Mar' 569 571 elseif vmnth == 4 570 572 let vmdays = 30 571 let vparam = 9 0573 let vparam = 91 572 574 let vsmnth = 'Apr' 573 575 elseif vmnth == 5 574 576 let vmdays = 31 575 let vparam = 12 0577 let vparam = 121 576 578 let vsmnth = 'May' 577 579 elseif vmnth == 6 578 580 let vmdays = 30 579 let vparam = 15 1581 let vparam = 152 580 582 let vsmnth = 'Jun' 581 583 elseif vmnth == 7 582 584 let vmdays = 31 583 let vparam = 18 1585 let vparam = 182 584 586 let vsmnth = 'Jul' 585 587 elseif vmnth == 8 586 588 let vmdays = 31 587 let vparam = 21 2589 let vparam = 213 588 590 let vsmnth = 'Aug' 589 591 elseif vmnth == 9 590 592 let vmdays = 30 591 let vparam = 24 3593 let vparam = 244 592 594 let vsmnth = 'Sep' 593 595 elseif vmnth == 10 594 596 let vmdays = 31 595 let vparam = 27 3597 let vparam = 274 596 598 let vsmnth = 'Oct' 597 599 elseif vmnth == 11 598 600 let vmdays = 30 599 let vparam = 30 4601 let vparam = 305 600 602 let vsmnth = 'Nov' 601 603 elseif vmnth == 12 602 604 let vmdays = 31 603 let vparam = 33 4605 let vparam = 335 604 606 let vsmnth = 'Dec' 605 607 else … … 607 609 return 608 610 endif 611 if vyear % 400 == 0 612 if vmnth == 2 613 let vmdays = 29 614 elseif vmnth >= 3 615 let vparam = vparam + 1 616 endif 617 elseif vyear % 100 == 0 618 if vmnth == 2 619 let vmdays = 28 620 endif 621 elseif vyear % 4 == 0 622 if vmnth == 2 623 let vmdays = 29 624 elseif vmnth >= 3 625 let vparam = vparam + 1 626 endif 627 endif 609 628 610 629 " calc vnweek of the day 611 630 if vnweek == -1 612 let vnweek = ( vyear * 365 ) + vparam + 1631 let vnweek = ( vyear * 365 ) + vparam 613 632 let vnweek = vnweek + ( vyear/4 ) - ( vyear/100 ) + ( vyear/400 ) 614 if v mnth < 3 && vyear % 4 == 0633 if vyear % 4 == 0 615 634 if vyear % 100 != 0 || vyear % 400 == 0 616 635 let vnweek = vnweek - 1 … … 618 637 endif 619 638 let vnweek = vnweek - 1 620 endif621 if vmnth == 2622 if vyear % 400 == 0623 let vmdays = 29624 elseif vyear % 100 == 0625 let vmdays = 28626 elseif vyear % 4 == 0627 let vmdays = 29628 endif629 639 endif 630 640 … … 644 654 elseif exists('g:calendar_weeknm') 645 655 " if given g:calendar_weeknm, show week number(ref:ISO8601) 646 let viweek = (vparam + 1)/ 7647 let vfweek = (vparam + 1)% 7656 let viweek = vparam / 7 657 let vfweek = vparam % 7 648 658 if vnweek == 0 649 659 let vfweek = vfweek - 7 … … 670 680 endif 671 681 let vcolumn = vcolumn + 5 672 if ((vyear % 4 == 0 && vmnth >= 3) || (vyear-1) % 4 == 0)673 let viweek = viweek + 1674 endif675 682 endif 676 683 … … 1216 1223 "***************************************************************** 1217 1224 function! s:CalendarHelp() 1225 echohl None 1226 echo 'Calendar version ' . g:calendar_version 1218 1227 echohl SpecialKey 1219 1228 echo '<s-left> : goto prev month'
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)