Commit 37560b27 authored by Nicolas Delaby's avatar Nicolas Delaby

Cosmetics Changes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24519 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12981787
...@@ -148,7 +148,6 @@ def getClosestDate(date=None, target_date=None, ...@@ -148,7 +148,6 @@ def getClosestDate(date=None, target_date=None,
If before is set to 1, return the closest date before target_date, If before is set to 1, return the closest date before target_date,
unless the closest date after target_date unless the closest date after target_date
Example : Example :
date=None, target_date=DateTime('2004/03/12'), precision='month', before=1 date=None, target_date=DateTime('2004/03/12'), precision='month', before=1
...@@ -179,7 +178,6 @@ def getClosestDate(date=None, target_date=None, ...@@ -179,7 +178,6 @@ def getClosestDate(date=None, target_date=None,
return return_date return return_date
def getIntervalBetweenDates(from_date=None, to_date=None, def getIntervalBetweenDates(from_date=None, to_date=None,
keys={'year':1, 'month':1, 'day':1}): keys={'year':1, 'month':1, 'day':1}):
""" """
...@@ -220,7 +218,6 @@ def getIntervalBetweenDates(from_date=None, to_date=None, ...@@ -220,7 +218,6 @@ def getIntervalBetweenDates(from_date=None, to_date=None,
returned_value[key] = value returned_value[key] = value
return returned_value return returned_value
def getIntervalListBetweenDates(from_date=None, to_date=None, def getIntervalListBetweenDates(from_date=None, to_date=None,
keys={'year':1, 'month':1, 'week' : 1, 'day':1}): keys={'year':1, 'month':1, 'week' : 1, 'day':1}):
""" """
...@@ -286,7 +283,6 @@ def getCompletedMonthBetween(from_date=None, to_date=None, ...@@ -286,7 +283,6 @@ def getCompletedMonthBetween(from_date=None, to_date=None,
is considered as a complete one. is considered as a complete one.
reference_date is used to know when a month begins. reference_date is used to know when a month begins.
Example : Example :
from_date = 2003/01/02, to_date = 2003/06/30 from_date = 2003/01/02, to_date = 2003/06/30
...@@ -299,7 +295,6 @@ def getCompletedMonthBetween(from_date=None, to_date=None, ...@@ -299,7 +295,6 @@ def getCompletedMonthBetween(from_date=None, to_date=None,
to_date = getClosestDate(target_date = to_date, date = reference_date, before = 0) to_date = getClosestDate(target_date = to_date, date = reference_date, before = 0)
return getIntervalBetweenDates(from_date = from_date, to_date = to_date, keys = {'month':1} ) return getIntervalBetweenDates(from_date = from_date, to_date = to_date, keys = {'month':1} )
def getRoundedMonthBetween(from_date=None, to_date=None, rounded_day=False): def getRoundedMonthBetween(from_date=None, to_date=None, rounded_day=False):
""" """
Return a rounded number of months between the both given dates. Return a rounded number of months between the both given dates.
...@@ -320,7 +315,6 @@ def getRoundedMonthBetween(from_date=None, to_date=None, rounded_day=False): ...@@ -320,7 +315,6 @@ def getRoundedMonthBetween(from_date=None, to_date=None, rounded_day=False):
return_value += 1 return_value += 1
return return_value return return_value
def getMonthFraction(date, days): def getMonthFraction(date, days):
""" """
Return a ratio corresponding to the fraction of the month Return a ratio corresponding to the fraction of the month
...@@ -345,7 +339,6 @@ def getYearFraction(days=None, months=None, days_in_year=number_of_days_in_year) ...@@ -345,7 +339,6 @@ def getYearFraction(days=None, months=None, days_in_year=number_of_days_in_year)
else: else:
return days / days_in_year return days / days_in_year
def getAccountableYearFraction(from_date=None, to_date=None): def getAccountableYearFraction(from_date=None, to_date=None):
""" """
Returns a year fraction according to accounting rules, Returns a year fraction according to accounting rules,
...@@ -374,7 +367,6 @@ def getAccountableYearFraction(from_date=None, to_date=None): ...@@ -374,7 +367,6 @@ def getAccountableYearFraction(from_date=None, to_date=None):
year_fraction += (1 / accountable_months_in_year) * ( days / accountable_days_in_month) year_fraction += (1 / accountable_months_in_year) * ( days / accountable_days_in_month)
return year_fraction return year_fraction
def getBissextilCompliantYearFraction(from_date=None, to_date=None, reference_date=DateTime('2000/01/01')): def getBissextilCompliantYearFraction(from_date=None, to_date=None, reference_date=DateTime('2000/01/01')):
""" """
Returns a ratio corresponding to the fraction of the year Returns a ratio corresponding to the fraction of the year
...@@ -392,7 +384,6 @@ def getBissextilCompliantYearFraction(from_date=None, to_date=None, reference_da ...@@ -392,7 +384,6 @@ def getBissextilCompliantYearFraction(from_date=None, to_date=None, reference_da
return_value = interval['year'] + getYearFraction(days=interval['day'], days_in_year=days_in_year) return_value = interval['year'] + getYearFraction(days=interval['day'], days_in_year=days_in_year)
return return_value return return_value
def getDecimalNumberOfYearsBetween(from_date, to_date, reference_date=DateTime('2000/01/01')): def getDecimalNumberOfYearsBetween(from_date, to_date, reference_date=DateTime('2000/01/01')):
""" """
Return a float representing the number of years between Return a float representing the number of years between
...@@ -413,7 +404,6 @@ def getDecimalNumberOfYearsBetween(from_date, to_date, reference_date=DateTime(' ...@@ -413,7 +404,6 @@ def getDecimalNumberOfYearsBetween(from_date, to_date, reference_date=DateTime('
return fraction return fraction
def roundMonthToGreaterEntireYear(months_number): def roundMonthToGreaterEntireYear(months_number):
""" """
Round the given number of months in order to have an entire Round the given number of months in order to have an entire
...@@ -424,7 +414,6 @@ def roundMonthToGreaterEntireYear(months_number): ...@@ -424,7 +414,6 @@ def roundMonthToGreaterEntireYear(months_number):
years_number += 1 years_number += 1
return int(years_number) * 12 return int(years_number) * 12
def roundDate(date): def roundDate(date):
""" """
Returns a date at 0:00 Returns a date at 0:00
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment