summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz Stampfl <47084093+LaurenzV@users.noreply.github.com>2023-05-23 10:41:20 +0200
committerGitHub <noreply@github.com>2023-05-23 10:41:20 +0200
commit752817ae74607ca23ec0aad51824ddca66faa7a8 (patch)
treed9f51f3d029c1ca8754be9ae9ccc9dc91ae6b000 /src/lib.rs
parentf4fd6855e7fb833a2125d2e81aa3b9f548b18170 (diff)
Add support for date & time handling (#435)
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c8878466..646f3922 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -58,7 +58,7 @@ use comemo::{Prehashed, Track, TrackedMut};
use crate::diag::{FileResult, SourceResult};
use crate::doc::Document;
-use crate::eval::{Library, Route, Tracer};
+use crate::eval::{Datetime, Library, Route, Tracer};
use crate::font::{Font, FontBook};
use crate::syntax::{Source, SourceId};
use crate::util::Buffer;
@@ -116,4 +116,10 @@ pub trait World {
/// Try to access a file at a path.
fn file(&self, path: &Path) -> FileResult<Buffer>;
+
+ /// Get the current date.
+ ///
+ /// If no offset is specified, the local date should be chosen. Otherwise,
+ /// the UTC date should be chosen with the corresponding offset in hours.
+ fn today(&self, offset: Option<i64>) -> Option<Datetime>;
}