diff --git a/README.md b/README.md
index f34945225..5318a7b16 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[](https://www.npmjs.org/package/liquidjs)
[](https://www.npmjs.org/package/liquidjs)
[](https://coveralls.io/github/harttle/liquidjs?branch=master)
-[](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
+[](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
[](https://github.com/harttle/liquidjs/blob/master/LICENSE)
[](https://github.com/harttle/liquidjs)
diff --git a/docs/themes/navy/layout/partial/all-contributors.swig b/docs/themes/navy/layout/partial/all-contributors.swig
index 589f4e17e..51ae62355 100644
--- a/docs/themes/navy/layout/partial/all-contributors.swig
+++ b/docs/themes/navy/layout/partial/all-contributors.swig
@@ -56,6 +56,11 @@
 |
 |
 |
+  |
+  |
+  |
+  |
+  |
diff --git a/src/filters/date.ts b/src/filters/date.ts
index 6483590c7..0f7360814 100644
--- a/src/filters/date.ts
+++ b/src/filters/date.ts
@@ -1,14 +1,12 @@
import { toValue, stringify, isString, isNumber, TimezoneDate, LiquidDate, strftime, isNil } from '../util'
import { FilterImpl } from '../template'
-const DEFAULT_FMT = '%A, %B %-e, %Y at %-l:%M %P %z'
-
export function date (this: FilterImpl, v: string | Date, format?: string, timezoneOffset?: number | string) {
const opts = this.context.opts
let date: LiquidDate
v = toValue(v)
format = toValue(format)
- if (isNil(format)) format = opts.dateFormat ?? DEFAULT_FMT
+ if (isNil(format)) format = opts.dateFormat
else format = stringify(format)
if (v === 'now' || v === 'today') {
date = new Date()
diff --git a/src/liquid-options.ts b/src/liquid-options.ts
index 5e45620f2..510e010c0 100644
--- a/src/liquid-options.ts
+++ b/src/liquid-options.ts
@@ -120,6 +120,7 @@ export interface NormalizedFullOptions extends NormalizedOptions {
strictVariables: boolean;
ownPropertyOnly: boolean;
lenientIf: boolean;
+ dateFormat: string;
trimTagRight: boolean;
trimTagLeft: boolean;
trimOutputRight: boolean;
@@ -146,6 +147,7 @@ export const defaultOptions: NormalizedFullOptions = {
fs: fs,
dynamicPartials: true,
jsTruthy: false,
+ dateFormat: '%A, %B %-e, %Y at %-l:%M %P %z',
trimTagRight: false,
trimTagLeft: false,
trimOutputRight: false,
diff --git a/test/unit/context/context.ts b/test/unit/context/context.ts
index 3436334fa..c5099498c 100644
--- a/test/unit/context/context.ts
+++ b/test/unit/context/context.ts
@@ -128,6 +128,14 @@ describe('Context', function () {
ctx.push({ foo: Object.create({ bar: 'BAR' }) })
return expect(ctx.get(['foo', 'bar'])).to.equal(undefined)
})
+ it('should use prototype when ownPropertyOnly=false', function () {
+ ctx = new Context({ foo: Object.create({ bar: 'BAR' }) }, { ownPropertyOnly: false } as any)
+ return expect(ctx.get(['foo', 'bar'])).to.equal('BAR')
+ })
+ it('renderOptions.ownPropertyOnly should override options.ownPropertyOnly', function () {
+ ctx = new Context({ foo: Object.create({ bar: 'BAR' }) }, { ownPropertyOnly: false } as any, { ownPropertyOnly: true })
+ return expect(ctx.get(['foo', 'bar'])).to.equal(undefined)
+ })
it('should return undefined for Array.prototype.reduce', function () {
ctx.push({ foo: [] })
return expect(ctx.get(['foo', 'reduce'])).to.equal(undefined)