~torresjrjr/hare

e2659e0e2a2f4249bf28f7b76cb19a100d189a0a — Byron Torres 2 months ago 05d7dc1
time::chrono,datetime: gettime -> time
3 files changed, 7 insertions(+), 7 deletions(-)

M datetime/arithmetic.ha
M datetime/chronology.ha
M time/chrono/chronology.ha
M datetime/arithmetic.ha => datetime/arithmetic.ha +1 -1
@@ 374,7 374,7 @@ export fn add(dt: datetime, flag: calculus, pp: period...) datetime = {
				p.nanoseconds %= ns_in_day;
			};

			let new_time = chrono::gettime(&dt) + p.nanoseconds;
			let new_time = chrono::time(&dt) + p.nanoseconds;

			if (new_time >= ns_in_day) {
				overflowed_days += 1;

M datetime/chronology.ha => datetime/chronology.ha +4 -4
@@ 238,7 238,7 @@ fn _isoweek(dt: *datetime) int = {
fn _hour(dt: *datetime) int = {
	match (dt.hour) {
	case void =>
		const hmsn = calc_hmsn(chrono::gettime(dt));
		const hmsn = calc_hmsn(chrono::time(dt));
		dt.hour = hmsn.0;
		dt.minute = hmsn.1;
		dt.second = hmsn.2;


@@ 252,7 252,7 @@ fn _hour(dt: *datetime) int = {
fn _minute(dt: *datetime) int = {
	match (dt.minute) {
	case void =>
		const hmsn = calc_hmsn(chrono::gettime(dt));
		const hmsn = calc_hmsn(chrono::time(dt));
		dt.hour = hmsn.0;
		dt.minute = hmsn.1;
		dt.second = hmsn.2;


@@ 266,7 266,7 @@ fn _minute(dt: *datetime) int = {
fn _second(dt: *datetime) int = {
	match (dt.second) {
	case void =>
		const hmsn = calc_hmsn(chrono::gettime(dt));
		const hmsn = calc_hmsn(chrono::time(dt));
		dt.hour = hmsn.0;
		dt.minute = hmsn.1;
		dt.second = hmsn.2;


@@ 280,7 280,7 @@ fn _second(dt: *datetime) int = {
fn _nanosecond(dt: *datetime) int = {
	match (dt.nanosecond) {
	case void =>
		const hmsn = calc_hmsn(chrono::gettime(dt));
		const hmsn = calc_hmsn(chrono::time(dt));
		dt.hour = hmsn.0;
		dt.minute = hmsn.1;
		dt.second = hmsn.2;

M time/chrono/chronology.ha => time/chrono/chronology.ha +2 -2
@@ 12,7 12,7 @@ export type invalid = !void;
// via the .loc field.
//
// Moments observe a [[date]], time-of-day, and [[zone]], which are evaluated
// and accessed by the [[date]], [[gettime]], and [[lookupzone]] functions.
// and accessed by the [[date]], [[time]], and [[lookupzone]] functions.
//
// The [[time::chrono]] modules implements a small chronology of dates & times.
// Higher level modules like [[datetime]] expand upon this with more complex


@@ 71,7 71,7 @@ export fn date(m: *moment) i64 = {

// Evaluates, caches, and returns a [[moment]]'s observed time-of-day as a
// [[time::duration]] since the start of a day.
export fn gettime(m: *moment) time::duration = {
export fn time(m: *moment) time::duration = {
	match (m.time) {
	case let t: time::duration =>
		return t;