class Responses::UserTimeSummary
- Responses::UserTimeSummary
- Reference
- Object
Included Modules
- JSON::Serializable
Defined in:
responses/user_time_summary.crConstructors
- .new(user : User, entries : Array(Entry), work_days : Int32, default_work_hours_per_day : Float64, show_extra = false, is_admin = false)
- .new(pull : JSON::PullParser)
Instance Method Summary
- #admin : Responses::Admin
- #email : String
- #extra : Responses::Extra
- #first_name : String
- #full_name : String
-
#hours : Float64
Hours registered.
-
#hours_goal : Float64
Work hour goal for user.
-
#hours_registered : Float64
Hours registered, rounded to two decimals.
- #id : Int64
- #last_name : String
- #process_entry(entry : Entry)
-
#round
Round off numbers for display.
-
#rounded_hours : Float64
Hours registered, rounded to 15 minutes, as used in billing.
-
#rounded_hours_registered : Float64
Hours rounded to 15 minutes, as used in billing.
- #working_hours_per_day : Float64
Constructor Detail
def self.new(user : User, entries : Array(Entry), work_days : Int32, default_work_hours_per_day : Float64, show_extra = false, is_admin = false)
#
Instance Method Detail
def round
#
Round off numbers for display.
to_json shows the numbers with maximum precision, which includes floating point rounding errors. The old PHP version used two decimals, as it rounds per default. So stick to the legacy behaviour.