ホーム
おまかせ表示
ログイン
設定
脳科学辞典について
免責事項
脳科学辞典
検索
モジュール:Dateのソースを表示
←
モジュール:Date
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
--[[ This module is intended for processing of date strings ]] local date = {} --[[ ISOyear This function returns year part of date string. Usage: {{#invoke:Date|ISOyear|s=target_string}} Parameters s: The date string If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. ]] function date.ISOyear( frame ) local s = frame.args.s -- if empty string then return it if mw.ustring.len(s) == 0 then return s end -- if number then return it if tonumber( s ) then return mw.ustring.format('%04i', s) end -- otherwise use regular expression match s = mw.ustring.match( s, '(-?%d%d?%d?%d?)-' ) if s then return mw.ustring.format('%04i', s) else return '' end end return date
このページで使用されているテンプレート:
モジュール:Date/doc
(
ソースを閲覧
)
モジュール:Date
に戻る。