extends Resource
class_name Moment

export(int, 0,22) var hour:int # Hour alarm should go off
export(int, 0,59) var minute:int # Minute alarm should go off

func _init(h:int=0,m:int=0):
	hour = h
	minute = m

func padded_minute()->String:
	return str(minute).pad_zeros(2)

func padded_hour()->String:
	return str(hour).pad_zeros(2)

func padded_hour_12()->String:
	return str(hour_12()).pad_zeros(2)

func hour_12()->int:
	return hour % 12

func to_seconds()->int:
	return hour*60*60 + minute*60

func am_pm()->String:
	return 'am' if is_am() else 'pm'

func is_morning()->bool:
	# 5 to 12
	return hour <= 11 and hour >= 5

func is_am()->bool:
	return !is_pm()

func is_pm()->bool:
	return hour > 11
