Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

question type:Date can not use

  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178146 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
I list my error code

LimeSurvey 3.5.0\application\views\survey\questions\answer\date\selector\answer.twig(52)

{% set aJsonOption = json_encode({
53 'format' : dateformatdetailsjs,
54 'minDate' : mindate[0] == '{' ? '1900-01-01' : mindate,
55 'maxDate' : maxdate[0] == '{' ? '2037-12-31' : maxdate,
56 'sideBySide' : true
57 })
58 %}
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178147 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
I check my php data

1.mbstring
Multibyte Support:enabled
Multibyte string engine :libmbfl
HTTP input encoding translation:disabled
libmbfl version:1.3.2


2.json
json support:enabled
json version:1.2.1


Would i enable HTTP input encoding translation?
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178150 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
Hi everyone

I use internet to find answers today

PHP web shows that i should install json model

Should i try this?

php.net/manual/zh/json.installation.php
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 years 10 months ago #178154 by DenisChenu
Replied by DenisChenu on topic question type:Date can not use
Maybe someting related to twig issue only.

Did you update twig config ? (it can bne done by plugins or via config.php file).
Can you activate debug mode ?

I don't think «Did you mean "json_decode"?» is added by PHP

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178156 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
Can you activate debug mode ?

Ok,I try debug mode to find more informations
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178160 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
Do i ask a question

How to update twig config?
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178164 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
I po Stack Trace error

1.LimeSurvey 3.5.0\application\third_party\Twig\ExpressionParser.php(374): Twig_ExpressionParser->getFunctionNodeClass("json_encode", 52)
369
370 return $node;
371 }
372
373 $args = $this->parseArguments(true);
374 $class = $this->getFunctionNodeClass($name, $line);
375
376 return new $class($name, $args, $line);
377 }
378 }
379

2.LimeSurvey 3.5.0\application\third_party\Twig\ExpressionParser.php(162): Twig_ExpressionParser->getFunctionNode("json_encode", 52)
157 $node = new Twig_Node_Expression_Constant(null, $token->getLine());
158 break;
159
160 default:
161 if ('(' === $this->parser->getCurrentToken()->getValue()) {
162 $node = $this->getFunctionNode($token->getValue(), $token->getLine());
163 } else {
164 $node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine());
165 }
166 }
167 break;

3. LimeSurvey 3.5.0\application\third_party\Twig\ExpressionParser.php(102): Twig_ExpressionParser->parsePrimaryExpression()
097 $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed');
098
099 return $this->parsePostfixExpression($expr);
100 }
101
102 return $this->parsePrimaryExpression();
103 }
104
105 protected function parseConditionalExpression($expr)
106 {
107 while ($this->parser->getStream()->nextIf(Twig_Token::PUNCTUATION_TYPE, '?')) {
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178167 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
Tomorrow, i will try

1. how to update twig

2.update to new version limesurvey
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178185 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
Hi

I try to po some # to code

filename: answer.twig

{# Set option for launch, can not set to default : maybe more than one datetimepicker in page #}
{# get the same default value than qanda_helper #}
{#% set aJsonOption = json_encode({#
#'format' : dateformatdetailsjs,#
#'minDate' : mindate[0] == '{' ? '2018-01-01' : mindate,#
#'maxDate' : maxdate[0] == '{' ? '2037-12-31' : maxdate,#
#'sideBySide' : true#
# })#
#%#}

I view survey,datepick can show

BUT i finish survey, it show:[Could not convert date 11/19/2018 1:49 PM to format d.m.Y. Please check your date format settings.]
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 years 10 months ago #178190 by DenisChenu
Replied by DenisChenu on topic question type:Date can not use
Update to last version …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: ming123ABC
The topic has been locked.
  • ming123ABC
  • ming123ABC's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #178192 by ming123ABC
Replied by ming123ABC on topic question type:Date can not use
thank you
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose