אונטערשייד צווישן ווערסיעס פון "יחידה:טווח זמנים"

שטיץ אויך אידישע דאטומען (אנהייב)
(אפדעיט)
(שטיץ אויך אידישע דאטומען (אנהייב))
שורה 1: שורה 1:
local Date = require('Module:דאטום')
local Date = require('Module:דאטום')
local HDate = require('Module:אידישע דאטום')
local Arguments = require( "Module:Arguments" )
local Arguments = require( "Module:Arguments" )
--[[
Assuming a string representng a date is passed, this function tries to determine
whether the date is Hebrew
]]
local function isHDate(str)
  -- quick heuristic: date without numeric digit is probably hebrew
  if string.match(str, "%d") then
    return false
  else
    return true
  end
end


local function WikidataSimpleFill(parameter, entityId, property)  
local function WikidataSimpleFill(parameter, entityId, property)  
שורה 38: שורה 52:
local pointInTime = args['נקודת זמן']
local pointInTime = args['נקודת זמן']
local startDate = args['תאריך התחלה']
local startDate = args['תאריך התחלה']
if startDate ~= nil and isHDate(startDate) then
startDate = HDate.fromhebrew(startDate)
end
local endDate = args['תאריך סיום']
local endDate = args['תאריך סיום']
if endDate ~= nil and isHDate(endDate) then
endDate = HDate.fromhebrew(endDate)
end
local wikidataStartDate = args['תאריך התחלה-ויקינתונים'] or 'P580'
local wikidataStartDate = args['תאריך התחלה-ויקינתונים'] or 'P580'